GetScrInfo
- Last UpdatedOct 29, 2026
- 2 minute read
The function GetScrInfo gets information about an open project screen.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
GetScrInfo |
Graphic |
Synchronous |
Yes |
Supported |
Supported |
Supported |
Supported |
Supported |
Syntax
GetScrInfo(strScreenName,"tagResult",optNumResultType,optNumID)
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: If this parameter is enclosed in quotes, the string literal will be used. Otherwise, the value of the tag/expression will be used.
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 one of 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 Enforce Web functionality equivalence in local project screens option is selected in the project settings, this function cannot be called in VBScript Global Procedures, VBScript scripts (script groups), or other background tasks. This is because the function behaves differently depending on whether you view project screens locally (that is, on the same computer that hosts the project runtime) or remotely. 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)