GetScrInfo

Retrieves information from the project about an open screen.

Function Group Execution Windows Embedded Thin Client
GetScrInfo Graphic Synchronous Supported Supported Supported

Syntax

GetScrInfo( strScreenName, "tagResult", optNumResultType, optNumID )
strScreenName
The name of the screen for which information is required.
tagResult
The name of the tag that will receive the information retrieved by the function. This name must be enclosed in quotes, or the project will try to get the contents 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 by the tagResult parameter.
1 Writes the TOP screen coordinate to the tag specified by the tagResult parameter.
2 Writes the LEFT screen coordinate to the tag specified by the tagResult parameter.
3 Writes the BOTTOM screen coordinate to the tag specified by the tagResult parameter.
4 Writes the RIGHT screen coordinate to the tag specified by the tagResult parameter.

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 Open function.) This is an optional parameter; the default ID is 0.

Returned value

0 Success
-1 The first and/or second parameters are not strings.
-2 Memory allocation error.
-3 optNumResultType is zero, but tagResult does not specify an array tag.
-4 Invalid tag by the tagResult parameter.

Examples

Tag Name Expression
TagErrorCode GetScrInfo( "main" , "TagXY[0]" ) // Retrieves the TOP, LEFT, BOTTOM and RIGHT coordinates of the "main" screen and then writes them to the first four positions of the array tag TagXY.
TagErrorCode GetScrInfo( "main", "TagXY", 3 ) // Retrieves the BOTTOM coordinate of the "main" screen and then writes it to TagXY.
TagErrorCode GetScrInfo( "main" , "TagXY", 2, 10 ) // Retrieves the LEFT coordinate of the "main" screen with ID 10 and then writes it to TagXY.