Library tutorials & articles
Debugging
Immediate Window
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"
Related articles
Related discussion
-
Run-time error '91'
by converter2009 (1 replies)
-
VB6 Runtime error 381 subsript out of range Error
by Uncle (2 replies)
-
passing and reading parameters from using Shell
by jigartoliya (0 replies)
-
Convert C++ code to VB6
by mawcot (4 replies)
-
listbox scrollbar
by Dennijr (10 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
This thread is for discussions of Debugging.