Close
- Last UpdatedOct 29, 2026
- 1 minute read
Close is a built-in scripting function that closes an open project screen.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
Close |
Screen |
Asynchronous |
No |
Supported |
Supported |
Supported |
Supported |
Supported |
Syntax
Close(optStrScreen,optNumID)
Close ( optStrScreen { | ,optNumID } )
optStrScreen
The name of the screen to be closed. If this parameter is omitted, then the currently active screen will be printed.
optNumID
The specific ID or instance number of the screen to be closed, if there is more than one screen with the same name open. (The ID is assigned when the screen is opened with the Open function.)
This parameter is optional; if no value is specified, the default ID is 0.
Return value
This function returns no value.
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.
Also, in some cases, you do not need to call this function to close a screen because the screen will be closed automatically when another screen replaces it. For more information, see Screen Attributes.
Examples
Close the screen named "main":
Close("main")
Close the currently active screen:
Close()
Close the screen named "alarms":
Close("alarms")
Close the screen named "main" with ID 10:
Close("main",10)