windowglobalvalue(
WINDOW
,
VARIABLE
)
The windowglobalvalue( function accesses a windowglobal variable from other windows.
Parameters
This function has two parameters:
window – is the name of the window that contains the windowglobal variable. If this parameter is missing or empty (""
), the current window will be used. Note: This window must currently be open!
variable – is the name of the variable you want to access. In general, this variable name must be enclosed in quotes (unless you are using a formula to calculate the name).
Description
This function makes it possible to access a windowglobal variable from other windows. (Usually these variables can only be accessed from the window in which they were created.)
This example below assumes that there is a series of windows with names that end with (1), (2), (3) etc. It scans through the window until it finds a window where the Company variable is Apple. If it finds such a window it makes it the top window.
local wX, wName
wX=1
loop
wName=info("databasename")+":"+info("formname")+" ("+str(wX)+")"
stoploopif info("windows") notcontains wName
if windowglobalvalue(wName,"Company")="Apple"
window wName
rtn
endif
wX=wX+1
endloop
Note: In older versions of Panorama (version 6.0 and earlier), this function was called grabwindowvariable(
. For compatibility with legacy databases, this name still works.
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.
- windowglobal -- creates one or more windowglobal variables.
History
10.0 | Updated | Carried over from Panorama 6.0, but now allows the window parameter to be omitted (defaults to current window). Also, this function has a new name, it was formerly the grabwindowvariable( function (which still works for compatibility with legacy databases). |