The text of a manual · part 21 of 47
PDT 1100 Terminal Programmer's Guide: Chapter 10 Statement Reference, pages 181 to 190
Pages 181 to 190 of 413, from PDT 1100 Terminal Programmer's Guide
The original document is the PDF (3.5 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 PDT-1100
Page 181
Statement Reference
Syntax Error Error Code and Message Meaning error 71: Syntax error The data type on the right- and left-hand sides does not correspond. That is, the variable on the left-hand side is numeric but the expression on the right-hand side is a string, or vice versa.
Execution Error Error Code
Meaning
06h
The operation result is out of the allowable range.
0Fh
String length out of range (in a string assignment, the string length of the evaluated result on the right-hand side exceeds the maximum length of the string variable on the left-hand side.)
10h
Expression too long or complex.
10-71
Page 182
PDT 1100 Terminal Programmer’s Guide
LINE INPUT Statement Name: Line Input
Type: I/O Statement
Description Reads input from the keyboard into a string variable.
Syntax LINE INPUT [“prompt”{,|;}] stringvariable where: “prompt” = A string constant. stringvariable = A string variable.
Notes When execution reaches a LINE INPUT instruction, the program waits for the user to enter data from the keyboard and shows a prompting message specified by prompt. After entering data, press the ENT key. Then, the LINE INPUT instruction assigns the data to stringvariable. !
! !
A LINE INPUT statement cannot assign a numeric variable. (An INPUT statement can.) “prompt” is a prompting message displayed on the LCD. If “prompt” is followed by a semicolon, the LINE INPUT instruction displays the prompting message followed by a question mark and a space. LINE INPUT “data= ”;a$ data= ?
!
If “prompt” is followed by a comma, the instruction displays the prompting message with no question mark or space. LINE INPUT “data= ”,a$ data=
10-72
Page 183
Statement Reference
!
!
!
!
!
!
The cursor shape specified by the most recently executed LOCATE instruction takes effect. Even after execution of the CURSOR OFF instruction, the LINE INPUT instruction displays the cursor. Data entered by the user echoes back to the LCD. To assign it to stringvariable, press the ENT key. This also causes also a line feed. If you type no data and press the ENT key, a LINE INPUT instruction automatically assigns a null string to stringvariable. When echoed back data is displayed on the LCD, press the Clear key to erase all displayed data or BS key to erase the last character entered. If no data is displayed, pressing Clear or BS has no effect. String data is the maximum string length of stringvariable. Overflowed data is ignored. The sizes of prompting message literals, echoed back literals and cursor depend upon the screen mode and the display font size. If the standard-size font is selected, they appear in standard size; if the small-size font is selected, they appear in small size.
Syntax Error Error Code and Message Meaning error 71: Syntax error
INPUT is missing Neither a comma (,) or semicolon (;) follows “prompt”. “prompt” is not a string constant. stringvariable has a numeric variable. A semicolon (;) immediately follows LINE INPUT.
Reference Statements
INPUT and LOCATE
Functions
INKEY$ and INPUT$
10-73
Page 184
PDT 1100 Terminal Programmer’s Guide
LINE INPUT # Statement Name: Line Input #
Type: File I/O Statement
Description Reads data from a device I/O file into a string variable.
Syntax LINE INPUT # filenumber, stringvariable where: filenumber = A numeric expression which returns a value from 1 to
16. stringvariable = A string variable.
Notes LINE INPUT # reads data from a device I/O file (a communications device file or bar code device file) specified by filenumber and assigns it to stringvariable. !
filenumber is a number assigned to the device I/O file when it was opened.
!
A LINE INPUT # statement cannot assign a numeric variable. (an INPUT # statement can.) A LINE INPUT # instruction reads all of the string literals preceding a CR code in a communications device file and assigns them to stringvariable. The instruction does not read CR codes and LF codes which immediately follow a CR code. If a LINE INPUT # instruction reads data longer than the allowable string length before reading a CR code, it ignores the overflowed data and completes execution with no execution error. A LINE INPUT# instruction reads the scanned data from a bar code device file into stringvariable. If a LINE INPUT # instruction reads data longer than the allowable string length, it ignores the overflowed data and completes execution with no execution error. If the maximum number of digits is omitted in the read code specifications of the OPEN “BAR:” statement (except for the universal product codes), then the INPUT #
!
!
10-74
Page 185
Statement Reference instruction can read bar codes of up to 99 digits. To read bar codes of 40 digits or more, define a sufficient string variable length beforehand.
Syntax Error Error Code and Message Meaning error 71: Syntax error INPUT is missing. filenumber is missing. “prompt” is not a string constant. stringvariable has a numeric variable.
Execution Error Error Code
Meaning
34h
Bad file name or number ( filenumber of an unopened file specified.)
36h
Improper file type ( filenumber of a file other than device I/O files specified.)
3Ah
File number out of range.
Example LINE INPUT #fileNo,dat$
Reference Statements
INPUT#, OPEN “BAR:”, OPEN “COM:”, and CLOSE
Functions
INPUT$
10-75
Page 186
PDT 1100 Terminal Programmer’s Guide
LOCATE Statement Name: Locate
Type: I/O Statement
Description Moves the cursor to a specified position and changes the cursor shape.
Syntax Syntax 1 LOCATE [column][,row[,cursorswitch]]
Syntax 2 LOCATE ,, cursorswitch where:
Standard-size font
Small font column A numeric expression which returns A numeric expression which returns a value from 1 to 17.
a value from 1 to 17.
row A numeric expression which returns A numeric expression which returns a value from 1 to 6.
a value from 1 to 8.
cursorswitch A numeric expression which returns A numeric expression which returns a value from 0 to 2.
a value from 0 to 2.
Notes LOCATE moves the cursor to a position specified by column number and row number as coordinates on the LCD. It also changes the cursor shape as specified by cursorswitch. ! !
The cursor location in the upper left corner of the LCD is 1, 1 which is the default. cursorswitch specifies the cursor shape as listed below. cursorswitch value
10-76
Cursor shape
0
Invisible
1
Underline cursor (default)
2
Full block cursor
Page 187
Statement Reference
!
Specification of the maximum value to column moves the cursor off the screen and out of sight. If you display data on the screen under the above condition, the cursor moves to the first column of the next row, from where the data appears.
!
If you specify the right end of the bottom line as the desired cursor position when the system status is displayed, the cursor becomes invisible. If a parameter is omitted, the current value remains active. If you omit column, for example, the cursor stays in the same column but moves to the newly specified row position. Any parameter value outside the range results in an execution error.
!
!
Execution Error Error Code
Meaning
05h
Parameter out of range.
Example LOCATE 1,2 LOCATE xPos,xCSRLIN LOCATE ,,2
Reference Functions
CSRLIN and POS
10-77
Page 188
PDT 1100 Terminal Programmer’s Guide
ON ERROR GOTO Statement Name: On Error Goto
Type: Error Control Statement
Description Enables error trapping.
Syntax ON ERROR GOTO label
Notes ON ERROR GOTO enables error trapping so as to pass control to the first line of an errorhandling routine specified by label if an error occurs during program execution. ! !
!
!
10-78
Use a RESUME statement in an error-handling routine to a specified program location. Assigning zero (0) to label disables error trapping. If ON ERROR GOTO 0 is executed outside the error-handling routine, any error displays a regular execution error code and terminates the program. If ON ERROR GOTO 0 is executed inside the error-handling routine, the Interpreter displays the regular execution error code and terminates the program. You cannot trap errors which may occur during execution of the error-handling routine. The occurrence of such an error displays an execution error code and terminates the program. You can use ON ERROR GO TO instead of ON ERROR GOTO.
Page 189
Statement Reference
Syntax Error Error Code and Message Meaning error 71: Syntax error label has not been defined. label is missing.
Reference Statements
RESUME
Functions
ERR and ERL
10-79
Page 190
PDT 1100 Terminal Programmer’s Guide
ON...GOSUB and ON...GOTO Statement Name: On ... Gosub and On ... Goto
Type: Flow Control Statement
Description Branches to one of specified labels according to the value of an expression.
Syntax Syntax 1 ON expression GOSUB label [,label...]
Syntax 2 ON expression GOTO label [,label...] where: expression = A numeric expression which returns a value from 1 to 255.
Notes ON...GOSUB or ON...GOTO block branches to a label in the label list according to the value of expression. !
!
!
! !
!
10-80
If expression has the value 3, for example, the target label is the third in the label list. If expression has the value 0 or a value greater than the number of labels in the label list, executing the ON...GOSUB or ON...GOTO block passes control to the subsequent statement with no execution error. You can specify any number of labels as long as a statement block does not exceed one program line (512 characters). You can nest ON...GOSUB instructions to a maximum of 10 levels. When using the GOSUB statement with block-structured statements (FOR...NEXT, IF...THEN...ELSE...END IF, SELECT...CASE...END SELECT, and WHILE...WEND), you can nest them to a maximum of 30 levels. You can use ON...GO TO instead of ON...GOTO.