InKey Command << Back



Let's say you are doing some quick test program in VDF, and you are probably going to show some results to the Output Window by using ShowLn. The common practice is to show a message box at the end program so that you can examine the Output Window. For example

Use Windows
Global_Variable String gsFileList 255
Get_Attribute DF_FILELIST_NAME to gsFileList
Showln gsFileList
Send Info_Box "Done"

A tiny drawback from the example above is that you can't scroll the content of the Output Window because the Info_Box is using the Output Window as a parent window, causing the Output Window to be disabled when the Info_Box is up on the screen. This behavior was introduced in post VDF 11 era (or somewhere around that time). To workaround this behavior, we can use a really old command "InKey"

Use UI // Windows
Global_Variable String gsFileList 255
Get_Attribute DF_FILELIST_NAME to gsFileList
Showln gsFileList
InKey FieldIndex

The parameter for the InKey command doesn't really matter, so we will abuse the FieldIndex global variable. One thing you might notice is that we don't have to use the "Windows.pkg" anymore since InKey is part of the internal VDF runtime. We will also notice that you can now scroll through the Output Window if you have a lot of "Showln" in your program.

Free Web Hosting