Command Window

From Dabo Wiki
Jump to: navigation, search

The Command Window is a concept taken directly from the VisualFoxPro application. It allows you to interact with a live, running application to either debug problems, or to experiment with various changes. It allows you to execute commands and view the results of those commands. You can also scroll up to a previously executed command line and press Enter in order to place that command on the current line, where you can either edit it and press Enter to execute it.

By convention, the Command Window is created in the context of the active form. What this means is that the variable self is assigned to reference that window, allowing convenient access to the properties and methods of that form. There is also a neat trick for grabbing references to other objects in your app. To do this, make the Command Window active, and then place the mouse pointer over the object you are interested in (don't click on it, though!). Then type the following:

ref = dabo.ui.getMouseObject()

and the variable ref now contains a reference to the object under the mouse pointer. You can then interact directly with that object by executing commands such as:

ref.Caption = "St. Jimmy"

and the Caption of the object will immediately update to reflect that change.