%SCR_OPENLIBRARY

Open a window library

WSupported on Windows
USupported on Unix
VSupported on OpenVMS

 

channel = %SCR_OPENLIBRARY(library[, create])

or

xcall SCR_OPENLIBRARY(library[, create])

channel

The channel of the opened library if successful; otherwise 0. (^VAL)

library

The name of the window library file to open. (a)

create

(optional) A flag that indicates whether to create the library file. (n)

D_CREATE_NEVER

Do not create. (default)

D_CREATE_IFNEEDED

Create if it doesn’t exist.

D_CREATE_ALWAYS

Create even if it exists.

The %SCR_OPENLIBRARY function opens the specified window library file. If the library is already open, it is closed first and then reopened. If the open is successful, the channel is opened in the current environment. To promote it to global, use the U_GBLCHN subroutine.

If library does not specify an extension, it defaults to .ism.

If an error occurs, the error information is sent to the ESCRIPTERR_METHOD routine before this function returns.

A macro is provided in tools.def to simplify creating a library:

.define SCR_CREATELIBRARY(library) SCR_OPENLIBRARY(library,D_CREATE_ALWAYS)