You can use the immediate window in VB to get the current values of variables and to run other code. To show it click View | Immediate. You can only use the immediate window when code execution is paused.
Immediate Window
Entering a ? and then the variable name or property will return its value, press RETURN to execute the query. The text below will return the path of your application, the text in italics is a possible result. Values in Italics are return results.
? App.Path
C:AppPathApp.EXE
The following example will return the value of the caption property:
? Label1.Caption
&Cancel
or perform calulations using variables or just numbers:
? Text1 * 10
198
? 100 / 1.92
52.0833333333333
You can also run one line or multiple statements. For example:
frmMain.Visible = False
To enter multiple lines of code, without it executing immediately press CTRL+Return
Below are a few examples
' This will return the number of Forms loaded into the memory
? Forms.Count
' This will return the name of Form(0) which is stored in the memory
? Forms(0).Name
' This will display a message box
Msgbox "hello"
Comments