OpenPrevious

OpenPrevious is a built-in scripting function that re-opens the last screen to be closed.

Function Group Execution Windows Embedded Thin Client Mobile Access
OpenPrevious Screen Asynchronous Supported Supported Supported Supported

Syntax

  OpenPrevious(optNumX1,optNumY1,optNumX2,optNumX2)  
Web Studio Help nctions screen openprevious.xml d416179e95 OpenPrevious
optNumX1
optNumY1
optNumX2
optNumY2
The coordinates, in pixels, for the upper-left (X1,Y1) and lower-right (X2,Y2) corners of the screen.

These are optional parameters. If no values are specified, then the default screen size and location are used. For more information, see Screen Attributes.

Returned value

This function will return one of the following values:
Value Description
0 Failure
1 Success

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.

The following limitations also apply to how the function can be used in project screens in Mobile Access:
  • The function cannot be called from the sub-routine Screen_OnClose in the Screen Script; and
  • You should avoid creating a script that both shows a dialog box (e.g., a message box that is shown using the VBScript function MsgBox or the IWS built-in function ShowMessageBox) and opens or closes a screen. The Mobile Access web interface can display only one screen at a time, and opening a new screen will automatically close the previous one. Depending on the order of execution, this can lead to unexpected behavior such as a dialog box being orphaned or not being shown at all.

Examples

Open the previous screen using its default size and location:
  OpenPrevious()  
Open the previous screen in the top-left corner of the display and sized to 800×600:
  OpenPrevious( 0, 0, 800, 600 )  

OpenPrevious