windowglobal
VARIABLES
The windowglobal statement creates one or more windowglobal variables.
Parameters
This statement has one parameter:
variables – is a list of variables to be created. Each variable should be separated from the next by a comma. If a variable name contains spaces or punctuation it should be surrounded by chevron (« ») characters.
Description
This statement creates one or more variables that are specific to the current window. Window global variables may be used by any procedure as long as the same window is open, and remain active until you close the window.
The windowglobal statement reduces the chance for conflict between variables in the same database. It allows you to define the same variable name over and over again in different windows, with each window having a separate value. This is very useful when using window clones.
Window Clones
Panorama normally allows only a single window per form. However, if a form’s Allow clones option is enabled, a single form can be opened over and over again into multiple separate windows. Each window is a “clone” of the others.
A window clone cannot be opened manually - clone windows must be created with the openform statement in a procedure. Here is a typical procedure that opens a slightly offset clone of the current window:
setwindowrectangle rectangleadjust( info("windowrectangle"),10,10,10,10))
openform info("formname")
This procedure will not create a clone window unless the Allow Clones option is turned on.
Although any form can be cloned if the Allow Clones option is turned on, most forms will not work very intelligently if they are cloned. In general, a form that is designed to be cloned should not contain any fields or global variables, only windowglobal variables. If your form contains objects that are linked to a variable and the Allow Clones option is turned on, the objects will automatically create windowglobal variables instead of global variables. Since the windowglobal variables can be manipulated separately for each clone window you can control each clone window individually, even though all the clone windows use the same form template.
The example assumes that you have create a form called File Display that displays the contents of a text file using a Text Display object with the formula
fileload(wFolder,wFile)
The procedure below will open a new window and display the file.
local folder,file,type
openfiledialog folder,file,type,"TEXT"
if file="" stop endif
openform "File Display"
windowname file
windowglobal wFolder,wFile
wFolder=folder
wFile=file
showvariables wFolder,wFile
Each time you run this procedure another window will open.
See Also
- assign( -- assigns a value to a field or variable, also returning the value.
- assignglobal( -- assigns a value to a global variable (creating the variable if necessary).
- cache( -- stores a value in a temporary variable.
- cardvalidate -- verifies that a number is a valid credit card number.
- datatype( -- determines what kind of data is in a field or variable: text, number, etc.
- datavalue( -- returns the value of a field or variable: text, number, etc.
- fieldstotextvariables -- copies database fields into variables.
- fileglobal -- creates one or more fileglobal variables.
- fileglobalvalue( -- accesses a fileglobal or permanent variable from other databases.
- global -- creates one or more global variables.
- globalvalue( -- returns the value of a global variable.
- increment -- increments a field or variable.
- info("filevariables") -- builds a carriage return separated text array containing a list of the currently allocated fileglobal variables in the current database.
- info("globalvariables") -- builds a carriage return separated text array containing a list of the currently allocated global variables.
- info("localvariables") -- builds a carriage return separated text array containing a list of the currently allocated local variables.
- local -- creates one or more local variables.
- localparameters -- creates one or more local variables and assigns parameter values to them.
- localvalue( -- returns the value of a local variable.
- makefileglobals -- creates one or more fileglobal variables, and assigns a value to each new variable.
- makeglobals -- creates one or more global variables, and assigns a value to each new variable.
- makelocals -- creates one or more local variables, and assigns a value to each new variable.
- permanent -- creates one or more permanent variables.
- savelocalvariables -- saves local variables as a procedure.
- setfileglobal -- sets the value of a fileglobal variable (optionally in another database).
- setfilevariable -- sets the value of a fileglobal variable in another database.
- setpermanentvariable -- sets the value of a permanent variable in another database. The database must be open. An empty value will choose the currently active database.
- setwindowglobal -- sets the value of a windowglobal variable (optionally in another window).
- showvariables -- forces Panorama to update the display of one or more variables on every form in the active database.
- showwindowvariables -- forces Panorama to update the display of one or more variables in the currently active form.
- tokenname( -- returns the name of a field or variable (instead of the value contained in the field or variables).
- undefine -- destroys one or more variables.
- unpermanent -- converts one or more permanent variables into regular fileglobal variables. The variables will no longer be saved as part of the database.
- windowglobalvalue( -- accesses a windowglobal variable from other windows.
History
10.0 | No Change | Carried over from Panorama 6.0 |