IB Statements/access

From CometWiki

Jump to: navigation, search

ACCESS statement

Version 1: Accessing configured directories

Syntax: ACCESS (directory-access-block) [Comet-directory-name] [,EXCP=statement-label]

Discussion: This version of the ACCESS statement accesses configured Comet directories. The ACCESS statement may be used in any Internet Basic program.

The directory-access-block (DAB) parameter is an integer from 0 to 49. This may be a numeric constant, numeric variable, or a symbolic constant.

The Comet-directory-name parameter specifies the directory to be accessed. This parameter is a string constant or string variable with a length of three characters. If this parameter is omitted, the statement releases the directory access block (i.e., it "un-accesses" a directory).

The statement-label parameter specifies the branch label to which program control is transferred if an exception occurs.

Application note: The ACCESS statement is part of the system security scheme in Comet. Under a security version of the QMONITOR program, the ACCESS statement grants access to only the Comet directories listed under the user's password. In general, however, the ACCESS statement may be built into any Internet Basic application program to provide directory-level security.

Example: ACCESS (5) "SSI",EXCP=9000

In this example, the Comet directory named "SSI" is accessed as DAB 5. If an exception occurs when this statement is executed, program control is transferred to statement 9000.


Version 2: Accessing non-configured directories

Syntax: ACCESS (directory-access-block) Comet-directory-name, DIR=path-name [,EXCP=statement-label]

Discussion: This version of the ACCESS statement accesses up to 10 non-configured Comet directories. The ACCESS statement may be used in any Internet Basic program.

The directory-access-block (DAB) parameter is an integer from 0 to 49. This may be a numeric constant, numeric variable, or a symbolic constant.

The Comet-directory-name parameter specifies the directory to be accessed. This parameter is a string constant or string variable with a length of three characters.


If this parameter is omitted, the ACCESS statement releases the directory access block (i.e., it "un-accesses" a directory).

If the specified directory does not contain the QDIR.DIR and QDIR.I00 files, they will be created by Comet when the ACCESS statement is executed, and the specified Comet-directory-name will be assigned to this Comet directory.

The path-name parameter specifies the full path name of the directory being accessed. If the pathname does not exist, the program will encounter an exception 6.

The statement-label parameter specifies the branch label to which program control is transferred if an exception occurs.

Example: ACCESS (5) "ABC", DIR="c:\comet\abc", EXCP=9000

In this example, the Comet directory located at "c:\comet\abc" is accessed as DAB 5. If this is an existing Comet directory (one that contains the QDIR.DIR and QDIR.I00 files), its name (ABC) is assigned to the DAB. If it is not an existing Comet directory, the QDIR files are created, then the directory is opened with the name "ABC". If an exception occurs when this statement is executed, program control is transferred to statement 9000.

Personal tools