GetScrInfo

The function GetScrInfo gets information about an open project screen.

Function Group Execution Windows Embedded Thin Client Mobile Access
GetScrInfo Graphic Synchronous Supported Supported Supported Not supported

Syntax

  GetScrInfo(strScreenName,"tagResult",optNumResultType,optNumID)  
Web Studio Help function graphic getscrinfo.xml d135687e111 GetScrInfo

strScreenName
The name of the screen about which you want to get information.
tagResult
The name of the project tag that will receive the information.
Note: The tag name should be enclosed in quotes, as shown in the syntax diagram, or else the function will try to use the value of the tag.
optNumResultType
A numeric flag specifying the type of information to be retrieved by the function:
Value Description
0 Default value. Writes the TOP, LEFT, BOTTOM and RIGHT screen coordinates to each consecutive position of the array tag specified for tagResult.
1 Writes the TOP screen coordinate to the tag specified for tagResult.
2 Writes the LEFT screen coordinate to the tag specified for tagResult.
3 Writes the BOTTOM screen coordinate to the tag specified for tagResult.
4 Writes the RIGHT screen coordinate to the tag specified for tagResult.

This is an optional parameter; the default value is 0.

optNumID
The specific instance number of the screen. (The ID is assigned when the screen is opened with the function Open.) This is an optional parameter; the default ID is 0.

Returned value

This function returns the following possible values:
Value Description
-4 Invalid tag specified for tagResult.
-3 optNumResultType is 0, but an array tag is not specified for tagResult.
-2 Memory allocation error.
-1 String not specified for strScreenName and/or tagResult.
0 Function executed successfully.

Notes

If the option Enforce Web functionality equivalence is selected in the project settings, this function cannot be called from Global Procedures or Script worksheets. This is because the function is meaningful only when it is executed on stations that display project screens; it might cause unexpected behavior if it is called from background tasks that are executed on the project runtime server. For more information, see Preferences tab.

Examples

Retrieve the TOP, LEFT, BOTTOM and RIGHT coordinates of the “main” screen and then write them to the first four positions of the array tag TagXY:
  GetScrInfo("main","TagXY[0]")  
Retrieve the BOTTOM coordinate of the “main” screen and then write it to TagXY:
  GetScrInfo("main","TagXY",3)  
Retrieve the LEFT coordinate of the “main” screen with ID 10 and then write it to TagXY:
  GetScrInfo("main","TagXY",2,10)  

GetScrInfo