grabwindowvariable(
WINDOW
,
VARIABLE
)

The grabwindowvariable( 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 grabwindowvariable(wName,"Company")="Apple"
        window wName
        rtn
    endif
    wX=wX+1
endloop

See Also


History

VersionStatusNotes
1.0UpdatedCarried over from Panorama 6.0, but now allows the window parameter to be omitted (defaults to current window).