Using the Immediate Window

The Immediate window (Ctrl+G), which can be used when debugging or at design-time, is a very versatile feature of the editor: Think of it as a "scratch pad" for code.

In design mode, you can enter a question mark (?) and any expression into the Immediate window to be evaluated. Typing ?8*7 and pressing Enter, for example, returns 56 just below the expression in the Immediate window. You can even enter small procedures to be evaluated, although they must be entered as one line, such as the following:

In break mode, you can do anything you can in design mode, plus you can do the following:

• Find the value of variables:

?strname

Tip When capitalization matters

Capitalization in the Immediate window doesn't matter unless you have multiple variables with the same name but different capitalization.

• Assign new values to any local, module-level, or global variable: strname="some new value"

• Evaluate expressions: ?ActiveProject.Tasks(intBefore).Name = strName

Note Edit and re-evaluate an expression

You can edit an existing expression in the Immediate window and then press Enter to re-evaluate it, without having to type the expression anew.

Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment