IB Statements/mid

From CometWiki

Jump to: navigation, search

MID function

Syntax: MID(string-argument)

Discussion: The MID function returns a machine ID string and stores it in the string-argument. The eight-byte string is binary coded with a unique number based on the Comet serial number. Each byte of the machine ID string has a value in the range "00" to "FF" hex. Note: Beginning with Comet 2006.374 this function returns the Comet plug serial number.

Application note: Password validation routines can be developed for user applications using the MID function.

The string-argument must be a string variable (single-element or an element of a string array).

Example:

 LENGTH 8 & LOCAL VALUE$
 .
 .
 .
 MID(VALUE$)
 .
 .
 .

This example shows how the MID function is constructed. In the above example, an eight-byte string variable named VALUE$ is defined. In the Procedure Division of the program, the MID function is used to return a unique machine ID. This value is placed in the variable VALUE$.

Personal tools