The text of a manual · part 26 of 34
MCL-Designer for Phaser Series User's Guide, pages 207 to 216
Pages 207 to 216 of 288
The original document is the PDF (3.0 MB). 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 Symbol P360 and Symbol P460
Page 207
MCL-Code Reference Guide
IF (IF) Function Compares a variable with text and jumps to one of two routines, depending on the outcome of the comparison.
Syntax IF | text1 | test | text2 | true | false where:
Text1 = the first operand to compare. Test = the condition for the comparison. values for test: = equal to. > greater than. < less than.
Text2 = the second operand to compare. True = address or label of the next instruction if result is true. False = address or label of the next instruction if result is false.
Affected System Variables None
Note All comparisons are lexicographic, except when operand 1 and operand 2 are both integers.
Examples IF | &A0 | > | 999 | OVFLW | +1
Execute the OVFLW routine if the value in A0 is greater than 999. Execute the next instruction if the value in A0 is less than or equal to 999.
IF | &C0 | = | STOP | END | +1
Execute the END routine if the value in C0 is equal to “STOP”. Execute the next instruction if the value in C0 is not equal to “STOP”.
7-39
Page 208
MCL-Designer for Phaser Series User’s Guide
Input Hour (IH) Function Displays an input mask and waits for a time input with selected format.
Syntax IH | line | column | variable where:
Line = line of the input field on the display (range: 1 - 2 = screen line). Column = left most column of the input field. Variable = name of the variable to receive the input.
Affected System Variables None
Note Invalid time entry is rejected.
Example IH | 1 | 6 | A0
7-40
Lets user enter a hour with format HH: MM: SS in variable A0 at screen position (1,6).
Page 209
MCL-Code Reference Guide
Input Key (IK) Function Jumps to the associated label when one of the keys defined in the command argument list is pressed. (Defines HOT-KEYS).
Syntax IK | key1 | label [ | key2 | label ] .....[ | key n | label ] where:
Key 1 = name of the first key or time out value. Key n = name of the last key Label = destination address, if the key is pressed.
Key Code Values
Actual Keys Used
F0 to F9 = Function keys (F0 = <F10>, F1 = <F1>, F2 = <F2>, etc.). UP or DW = <Up> or <Down> arrow keys. PU or PD = <FN+UP> or <FN+DOWN> keys. Ax = Any alpha character on the keypad (AK = <K> key). Only uppercase is supported. Nx = Any character on the numeric keypad (N9 = <9> key). EN = <Enter> key. CL = <Fn+Bksp> key. SP = Special <*> key. ** = Any key (must be the last key of the list). BS = Backspace key
7-41
Page 210
MCL-Designer for Phaser Series User’s Guide
Affected System Variables 98 =
Set to KeyName of key pressed.
Notes 1. Key 1 can be a TIMEOUT, with a maximum value of 9999. (see the PI command for an explanation of TIMEOUT values). 2. Maximum 20 entries (including TO) 3. If ** is used, it must be placed at the end of the list because keys defined after ** are ignored.
Examples IK | F1 | HELP | F8 | END | CL | +1
Jump to the HELP label if the <F1> key is pressed. Jump to the END label if the <F8> key is pressed. Jump to current line +1 if the <FN+BKSP> key is pressed.
IK | F1 | HELP | ** | OUT
Jump to the HELP label if the <F1> key is pressed. Jump to the OUT label if any other key is pressed.
7-42
Page 211
MCL-Code Reference Guide
Input List (IL) Function Define a list input field, where several options may be accessed using a single field, scrolling through the available options. The index of the selection is returned in a variable.
Syntax IL | line | column | height | width | default | mode | speedkey | variable | sel1 [ | sel2 ]…[ | seln ] where:
line = line on which to begin field. column = column in which to begin field height = number of lines to be used (ignored by Phaser). width = number of columns to be used. default = Index of default selection. mode = Scrolling Mode. S = Scrolling: if user attempts to scroll beyond the start or end of the list, the scanner ignores the keypress and beeps. R = Rolling: if the user scrolls past the end of the list, the list rolls over back to the beginning. speedkey = Enable speed key processing. Note that the speedkey feature only works with numerics (0-9). 1 = Pressing the key corresponding to the first character of a list item moves directly to that selection (most useful if list items are numbered). 0 = Disable the speedkey feature.
variable = Variable to receive the selection. sel1 = Text of first available selection. seln = Text of last available selection.
7-43
Page 212
MCL-Designer for Phaser Series User’s Guide
Affected System Variables &98 =
The text of the selected entry or “TO” if time-out occurs.
&97 =
The index number of the selected entry.
Notes 1. The PI command is active in the IL command, so all defined hot-keys are still available. 2. The selected index will be returned in the variable. 3. If <UP> (UP Arrow) or <DW> (Down arrow) are used in PI before IL command, they will perform the action defined in PI only on <UP> on first item and <DW> on last item, and then only if mode is set to S. Otherwise, <UP> and <DW> switch the current selected item in the list.
Examples IL | 2 | 2 | 1 | 18 | 1 | S | 0 | A0 | 1. Inventory | 2. POS | 3. Shipping Define, at line 2, column 2, for 18 characters, an input list field which will scroll through the following selections, starting with selection 1: 1. Inventory 2. POS 3. Shipping If the user hits the UP key when selection 1 is displayed, the program will take whatever action is currently defined in the PI command for an up key. If the user hits the DOWN key when selection 1 is displayed, selection 2 will be displayed. The chosen selection number will be stored in A0. Speedkey processing is disabled.
7-44
Page 213
MCL-Code Reference Guide
Input eXtended (IX) Function Accepts any input from the keyboard or scanner.
Syntax IX | line | column | variable | minlength | maxlength | kb | scan | autoval | data | reset-var | scanret where:
Line = line of the input field on the display (range: 1 - 2 = screen line). Column = left most column of the input field. Variable = name of the variable to receive the input. Minlength = minimum length of the input field (min. = 0 char.). Maxlength = maximum length of the input field (max.= 55 char.). Kb = keyboard entry allowed (Y or N). Scan = scanning entry allowed (Y or N). Autoval = auto-validation (Y or N). If Y, scanner input is accepted without having to press <ENTER>, and keypad input of maxlength characters is accepted without having to press <ENTER>. If N, <ENTER> must be pressed to accept either scanner or keypad input.
Data = type of data. Valid entries are: A = alphanumeric. N = numeric. D = decimal (accept “.” or “,”). S = secret. “*” displayed in input field for every character entered.
Reset-var = reset variable? (Y or N). IfY, the destination variable is cleared before the input operation, and no default value is displayed on the screen; if N, then the current value of the variable is used as the default value, and displayed in the input field prior to accepting user input.
Scanret = scan-return-scan (Y or N). If Y, and scan is N, then scanning data on this field will cause the default value to be entered, and the next field to be accessed.
7-45
Page 214
MCL-Designer for Phaser Series User’s Guide
Affected System Variables Normal mode &91 =
Barcode Descriptor
&97 =
“?”
&98 = type of code: C39, I25, C128, E08, E13, C49, UPCE0, UPCE1, UPCA, MSI, CODABAR, D25, C11, C93, E128, Unknown or KB if keyboard input.
variable =
Contains the input data.
After TIMEOUT (if one has been defined in the previous PI command) &91 =
“?”
&97 =
“?”
&98 =
“TO” variable =
“?”
After EXIT KEY (defined in the previous PI command) &91 =
“?”
&97 = name of the pressed key (see PI command for keynames).
&98 =
“KB” variable =
“?”
Notes 1. If <CL> (Clear key) is used in PI before IX command, it performs the action defined in PI only on the first input position. Otherwise, <CL> clears the current input field. 2. The Barcode Descriptor is a string describing the barcode length and the barcode symbol type. Some host interface software requires this data to properly format the output string for the host device (Synapse hosts, and some RS232 host variants, for example). If your data will be transmitted to one of these hosts, you must save the Barcode Descriptor in your data file along with the barcode data, so that the proper formatting may be performed by the interface software. (See Serial Output (SO) P360/P460 Memory Scanner on page 7-73 and Serial Output (SO) - P370/P470 RF
7-46
Page 215
MCL-Code Reference Guide
Scanner on page 7-75 for a description of how to use this data in formatting you output.) 3. Setting SCAN-RET to Y overrides KB disable.
Example IX | 2 | 10 | A3 | 5 | 10 | Y | Y | Y | A | Y | N
Accepts input data on line 2, column 10 (minimum 5 characters, maximum 10 characters), and stores it in variable A3. The input can be entered from the keyboard or a scanner. The entry is automatically validated (if 10 characters long). The input is alphanumeric. Variable A3 is reset before executing the command.
7-47
Page 216
MCL-Designer for Phaser Series User’s Guide
LaBel (LB) Function Assigns a label to the current program address.
Syntax LB | label where:
Label = the name of the address (maximum 10 characters).
Affected System Variables None
Notes 1. Label can be alphanumeric, but the first character must be alpha or underscore (“_”) character 2. Label name must be unique for each program. 3. Maximum length = 10 characters.
Example LB | MAIN
7-48
Assigns the label “MAIN” to the current program address.