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


History

VersionStatusNotes
10.0UpdatedCarried 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).