User Exits

Top  Previous  Next

 

A user exit is essentially an extension to the QMBasic language. They originated in Pick systems and QM provides equivalent functionality as subroutines that are included in source form in the BP file of the QMSYS account. In most cases, the user exit subroutine is just one or two lines of QMBasic. Ideally, application code that calls a user exit should be modified to perform the relevant action inline.

 

A user exit is identified by a four digit hexadecimal number and executed by use of the OCONV() function with the conversion code formed from the letter U followed by the user exit number.

 

The user exits provided are:

 

0003

Returns the command line that started the program. Equivalent to use of @SENTENCE.

0004

Returns terminal settings such as characters per line and lines per page.

0005

Clear the type-ahead buffer. Equivalent to use of INPUTCLEAR.

000E

Returns the current account name. Equivalent to use of @ACCOUNT.

001C

Returns the number of fields used after a MATREAD. Equivalent to use of INMAT().

0021

Returns the lowercase version of a string. Equivalent to use of DOWNCASE().

0022

Returns the uppercase version of a string. Equivalent to use of UPCASE().

0032

Logs user off. Equivalent to chaining to the QUIT command.

0033

Returns a number as Roman numerals. Equivalent to use of the NR conversion code.

003F

Converts a hexadecimal string to characters and sends this to the default printer. Equivalent to printing the result of an MX0C conversion.

0089

Returns the result of converting a hexadecimal string to a binary number. Equivalent to a combination of XTD() and the MB conversion code.

0091

Returns the value of an environment variable. Equivalent to use of ENV().

009E

Returns the result of replacing a substring. Equivalent to use of CHANGE().

009F

Returns the result of converting a binary number to a hexadecimal string. Equivalent to a combination of DTX() and the MB conversion code.

00B9

Returns the soundex code for a string. Equivalent to use of SOUNDEX().

017E

Outputs data to the terminal or a printer. Equivalent to use of PRINT.

0209

Returns only the alphanumeric characters from a string. Equivalent to use of the MCAN conversion code.

1072

Returns a multi-field dynamic array in sorted order. Equivalent to use of the QMBasic sorting functions.

307A

Sleep until a specific time. Equivalent to use of SLEEP.

3090

Abort. Equivalent to use of ABORT.

4070

Direct output from PRINT to the screen. Equivalent to use of PRINTER OFF.

407A

Sleep for a specified interval. Equivalent to use of SLEEP.

50BB

Returns user number, account name and login name. Equivalent to use of @USERNO, @WHO and @LOGNAME.

60BB

Returns login name and account name. Equivalent to use of @LOGNAME and @WHO.

6193

Returns the last three characters of a string. Equivalent to use of a trailing substring operator.

7000

Returns the number of characters in a database record. Equivalent to use of TRANS() and LEN().

7193

Converts an external form of US date (mm dd yy) to a European date (dd mm yy). Equivalent to a concatenation of three substrings.

7201

Test whether there is keyboard input waiting. Equivalent to use of INPUT with a negative length qualifier.

8194

Returns the number of records selected after a SELECT. Equivalent to use of @SELECTED.

A116

Logout a specified user. Equivalent to execution of a LOGOUT command.

B070

Return the absolute value of a number. Equivalent to use of ABS().

 

 

In addition, the Proc processor supports three user exits that are only meaningful in a Proc. These are documented in more detail with the Proc processor.

 

01A6

Emit text and control codes to the screen.

01AD

Fetch data from a file.

31AD

Get the user number, placing it in a Proc buffer or displaying it on the screen.