13. Building Applications : The Globals Submenu of the Edit an Application Frame : Edit a Global Variable Definition Frame : How to Set Initial Values for Global Variables
 
Share this page                  
How to Set Initial Values for Global Variables
After you create a global variable, you must set its initial value before using it in your application. You must do this in the 4GL code for the application's starting frame or procedure. This ensures that you have initialized it before the application calls any frames or procedures that use the global variable.
When testing a frame that uses a global variable, start the application with the frame that initializes it. Then, proceed to the frame that you want to test. Otherwise, the test frame cannot run properly, because the statements that initialize its global variables have not been run.
See the 4GL section of this guide for a procedure that you can use to check whether you have set the initial value of a global variable. You can call this procedure from any frame or procedure that calls the global variable.