The text of a manual · part 15 of 26
IRL Programming Reference Manual, pages 141 to 150
Pages 141 to 150 of 260
The original document is the PDF (666 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Intermec 9445, Intermec 9550, Intermec 9560 and Intermec 9512
Page 141
A (ASCII Input)
7
For IRL v2.X, any partially accumulated input is discarded. For IRL v4.X, partially accumulated input is stored in $0. The timeout count is reset each time the input command receives one character of input. Return Value IRL v2.X:
Register $0 contains the input string. Register #0 (status register) indicates the result of the input: 0 1
Return Value IRL v4.X:
The input was received. The user-defined timeout elapsed before the data was fully received.
Register $0 contains the input string. Register #0 (status register) indicates the result of the input. Any value greater than 4 indicates that the command was successful. The following table lists the return values that apply
Notes:
Status Meaning
Status Meaning
0
Input timeout
14
Code 128
1–4
Not used
15
HIBC
5
Keypad
16
Code 16K
6
Code 39
17
Code 49
7
2 of 5 or Interleaved 2 of 5
18
Reserved
8
Codabar
19
Reserved
9
UPC/EAN
20
Reserved
10
Code 93
21
Reserved
11
Code 11
22
COM3 receive error
12
Plessey
23
Reserved
13
MSI Code
24
COM3 input
Data is appended to the contents of $0. If $0 is full, excess data is lost. All input is parsed for reader commands and valid reader commands are executed. See your reader manual for details on a specific reader command. All valid data is shown on the reader display.
7-9
Page 142
A (ASCII Input)
When you specify an entry length, the program only accepts input of that length. When you specify more than one length, the program only accepts input that matches one of the specified lengths. When you use a numeric register to define a fixed-length entry, values greater than the maximum length (128 or 250) are treated as 128 and 250, depending on the IRL version. Your reader always accepts Code 39 input for reader commands. You can disable Code 39 data input. Notes IRL v4.X:
You can use the set IM_IRL_STAT=n environment variable to use the IRL v2.X return values on JANUS readers. See Chapter 5, “Using IRL With JANUS Readers,” for help with setting environment variables.
Examples A
: Variable-length, full ASCII input with no timeout.
A6,3,2
: Six-, three-, or two-character long input.
A;900
: Variable-length input with nine second timeout.
A#2,6;6500 : Accepts input the length of the value in register #2 : or input that is six characters long. Timeout is 65 sec. A"@@@-###" : IRL 4.X. Accepts input that contains three letters, a : dash, and three numbers.
7-10
Page 143
B (Beep)
7
B (Beep) Purpose:
Signals the reader to sound a series of high or low beeps.
Syntax:
B n...n
Parameters:
n Specifies the tone instruction bit. You can set from 1 to 127 bits per Beep command. n is either 0 or 1. 0 1
Return Value:
Low Beep High Beep
None.
Examples B1010
: Reader sounds a high, low, high, then low beep.
B111
: Reader sounds three high beeps.
7-11
Page 144
C (Convert)
C (Convert) Purpose:
Converts string data to numeric data or numeric data to string data.
Syntax:
Cd=s
Parameters:
When Converting Numbers to Strings: d is the destination: either a string register ($n) or a record in a file F(n), where F is A through Z and n is the record number. s is the source: a numeric register #n, a floating point register %n, a numeric constant, or the expression [$n]. The brackets are required for [$n]. The expression [$n] retrieves the length of the string in register $n. The C command converts this value to string data. When Converting Strings to Numbers: d is the destination: either a numeric register #n or a floating point register %n. s is the source: a string register ($n), a record in a file F(n), or a literal string enclosed in quotes (" "). For a record in a file F(n), F is A through Z and n is the record number.
Return Value:
Both forms of the C command place a status code in register #0: 0 1 2 3
Notes:
During numeric-to-string conversion, the string equivalent of each digit of the numeric value is put in the string register or file record.
Notes:
During string-to-numeric conversion, the first seven or nine characters of the string are converted to a numeric equivalent. All leading non-digit characters are stripped. All non-leading, non-digit characters are converted to zeros (for example, abc12de converts to 1200).
Notes IRL v4.X:
7-12
Good convert More than 7 characters in string for IRL v2.X More than 9 characters in string for IRL v4.X Non-numeric characters in string Both 1 and 2 are true
The source file (s) can be an undimensioned file, but the destination file (d) cannot. If you specify an undimensioned file as a destination for C, the compiler generates a syntax error.
Page 145
C (Convert)
7
When Converting Floating Point Numbers to Strings: You can specify the number of places to the right of the decimal point to include. The default is two decimal places. Numbers smaller than the specified number of decimal places are converted to zero Use this format to specify decimal places: C$n = %n[x] where n is the register number, and x is the number of decimal places. Brackets [ ] are required if you specify x.
Examples C$0=100
: Numeric constant is converted to ASCII characters "100" in : register $0.
C$0=#2
: Number in register #2 is converted to ASCII characters.
C#1="!!!!12345" : After conversion, register #1 contains the number 123 : and the status register (#0) contains a 3. C#2=A(2)
: The string in the third record of file A is converted to a : number and placed in register #2. A status code is placed : in register #0.
C$1=[$0]
: The number of characters in register $0 is converted to a : string and placed in register $1.
7-13
Page 146
D (Define Data)
D (Define Data) Purpose:
Defines a numeric variable, floating point variable, or string variable to equal a constant, a variable, an arithmetic argument, or a string manipulation.
Syntax:
D s = arg
Parameters:
s is a numeric register #n, a floating point register %n, a string register $n, or a record in a file F(n). arg is the argument. The format for arg depends on the type of variable. For a Numeric or Floating Point Variable: The argument is a numeric constant, a numeric register, or an arithmetic expression involving numeric constants and numeric variables. arg can include one of these five arithmetic functions: + – * / [string]
Addition Subtraction Multiplication Division String length function
Numeric operations are valid only for operations that do not exceed the limitations of numeric variables. These rules apply: Negative results for a numeric variable return as 0 (zero) Dividing by 0 (zero) returns 9,999,999 for IRL v2.X Dividing by 0 (zero) returns 999,999,999 for IRL v4.X Maximum numeric value is 9,999,999 for IRL v2.X Maximum numeric value is 999,999,999 for IRL v4.X Minimum floating point value is ± 1.7 X 10-308 Maximum floating point value is ± 1.7 X 10+308 Parameters:
7-14
String Length Function This special arithmetic function retrieves the length of a string variable and places it in a numeric register. Use one of these forms:
Page 147
D (Define Data)
7
D#n=[F(n)] Place the length of the string in record n of file F into numeric register #n. D#n=[$n] Place the length of the string in register $n into numeric register #n. For a String Variable: The argument can be a literal string, a string register, a file record, or a string expression. You must enclose a literal string in quotation marks ("). See the examples. You clear string variables by defining them to an empty literal string (""). A string expression is either the concatenation or the copying of string variables and string constants. Concatenation and copy use the following format: Concatenation: Dd=a+b String variables a and b can be string registers or literal data. The string in b is appended to the end of string a, and the resulting string is placed into d. d is a register $n or a record in a file F(n). Strings greater than 128 characters, 250 characters, or the defined record size of F(n) are truncated at the maximum size. Left Copy: Dd=aLx The left x characters of string variable a are placed into d. d is a register $n or a record in a file F(n). Middle Copy: Dd=aMx,y The x number of characters, starting y characters (offset) from the left of string variable a are placed in string variable d. d is a register $n or a record in a file F(n). Right Copy: Dd=aRx The right x characters of string variable a are placed into d. d is a register $n or a record in a file F(n). Return Value:
None.
Notes:
You cannot define string data to a numeric variable, nor numeric data to a string variable. Use the C (Convert) command instead.
Notes IRL v4.X:
You cannot set a numeric register to a floating point register value, but you can set a floating point register to a numeric register value. These examples are valid expressions: D%1 = #2 and D%3 = %2 * #4.
7-15
Page 148
D (Define Data)
The source file (s) can be an undimensioned file, but the destination file (d) cannot. If you specify an undimensioned file as a destination for D, the compiler generates a syntax error. You can use the set IM_IRL_NUM=n environment variable to set the JANUS reader to use the same maximum number for numeric registers as the TRAKKER. See Chapter 5, “Using IRL With JANUS Readers,” for help with setting environment variables.
Examples Arithmetic Functions D#1=#1+1
: Increment value of #1 by 1.
D#1=10-#2
: Set #1 to 10 minus the contents of #2.
D#2=#0 * 100
: Set #2 to the contents of #0 multiplied by 100.
D%1=%2 * #3
: Set %1 to the contents of %2 (price) times #3 : (quantity). Result is a floating point number.
D#8=[$0]-[$3] : Subtract the length of string $0 from the length of : string $3. Save this value in numeric register #8.
String Functions D$1=A(n)
: Save record n of file A in string register $1.
D$3=$2M4,#3
: Set $3 to the 4 characters in $2, using the value in #3 : to determine the starting character count in $2. : If $2 = "super tanker", and #3 = 7, then the four : characters "tank" are saved in $3.
D$1=$1 + "files remaining" : Set $1 to the contents of $1 plus the : string "files remaining". D$0=$1R2
7-16
: Copy the right two characters of $1 into $0.
Page 149
E (End)
7
E (End) Purpose:
Ends the program.
Syntax:
E [a]
Parameters:
a is one of these optional modifiers: R T Z RZ TZ
Parameters IRL v4.1:
a is one of these optional modifiers: D R T Z RZ TZ
Return Value: Notes:
Exit the program and terminate Exit the program and terminate (same as R) Write protect the program, loop to beginning, and execute again Write protect and terminate the program Write protect and terminate the program (same as RZ)
Exit to DOS (IRL v4.1 only) Exit the program and terminate Exit the program and terminate (same as R) Write protect the program, loop to beginning, and execute again Write protect and terminate the program Write protect and terminate the program (same as RZ)
None. An unmodified E command always loops to beginning of the program and continues executing. If you specify the Z modifier, the program is write-protected when compiled and you cannot change it with the editor. Once you write protect the program, any subsequent E, ER, or ET commands do not remove the write protection. You can use more than one E command in a program, and you can use modified and unmodified E commands in the same program. The R and T modifiers work in exactly the same way. Both are supported for compatibility with older IRL programs.
Notes IRL v4.X:
If you write protect a file with the Z modifier, the DOS attribute for read only is set for the file. Use the ATTRIB command to remove write protection. When the reader executes the ED command, the register values, screen display, and location in the IRL program are saved. You can resume the program at the line immediately after the ED command. For more information, see Chapter 5, “Using IRL With JANUS Readers.”
7-17
Page 150
E (End)
Examples E
: Run this program from start.
ETZ
: Stop executing and write-protect this program.
ED
: Suspend current program, save program state info, and : exit to DOS.
7-18