The text of a manual · part 26 of 47
PDT 1100 Terminal Programmer's Guide: Chapter 10 Statement Reference, pages 231 to 240
Pages 231 to 240 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 231
Statement Reference
SCREEN Statement Name: Screen
Type: I/O Statement
Description Sets the screen mode and the character attribute.
Syntax Syntax 1 SCREEN screenmode[,charaattribute]
Syntax 2 SCREEN , charaattribute where: screenmode and charaattribute = A numeric expression which returns a value 0 or 1.
Notes SCREEN sets the screen mode and the character attribute of the LCD screen according to screenmode and charaattribute as listed below.
Screen mode Single-byte ANK mode (default) Character attribute screenmode 0 charaattribute
SCREEN statement SCREEN 0
SCREEN statement
Normal display (default)
0
SCREEN , 0
Reversed display
1
SCREEN , 1
!
At program start-up, the defaults – single-byte ANK mode and normal display – are active.
10-121
Page 232
PDT 1100 Terminal Programmer’s Guide
!
If a parameter is omitted, the corresponding screen mode or character attribute does not change.
Execution Error Error Code
Meaning
02h
Syntax error
05h
Parameter out of the range
10-122
Page 233
Statement Reference
SELECT...CASE...END SELECT Statement Name: Select ... Case ... End Select
Type: Flow Control Statement
Description Conditionally executes a statement block depending upon the value of an expression.
Syntax SELECT conditionalexpression CASE test1
[statementblock] [CASE test2 [statementblock]]... [CASE ELSE [statementblock]] END SELECT where: conditionalexpression, test1 and test2 = A numeric or string expression.
Notes This instruction executes one of the statementblocks depending upon the value of conditionalexpression according to the steps below. 1. SELECT evaluates conditionalexpression and compares it with tests sequentially to look for a match. 2. When a match is found, the associated statementblock executes and passes control to the first statement following the END SELECT. If no match is found, the statementblock following the CASE ELSE executes and passes control to the first statement following the END SELECT. If you include no CASE ELSE, control passes to the first statement following the END SELECT. 10-123
Page 234
PDT 1100 Terminal Programmer’s Guide
!
!
! !
If the SELECT statement block includes more than one CASE statement containing the same value of test, only the first CASE statement executes and passes control to the first statement following the END SELECT. If no executable statement follows a CASE, control passes to the first statement following the END SELECT. conditionalexpression (numeric or string) and tests must agree in type. Up to 10 levels of SELECT...CASE...END SELECT instructions can be nested. SELECT a CASE 1 SELECT b CASE 3 PRINT “a=1,b=3” END SELECT CASE 2 PRINT “a=2” END SELECT
!
When using the SELECT...CASE statement block with other block-structured statements ( FOR...NEXT, IF...THEN...ELSE...END IF, and WHILE...WEND), you can nest them up to 30 levels.
Syntax Error Error Code and Message Meaning error 26:
Too many nesting levels.
error 55: Incorrect use CASE, CASE ELSE, or END SELECT statement appears outside of the of SELECT...CASE...END SELECT statement block. SELECT error 56: Incomplete control structure
No END SELECT corresponds to SELECT.
error 71: Syntax error conditionalexpression and tests do not agree in type.
10-124
Page 235
Statement Reference
Execution Error Error Code
Meaning
0Ch
CASE and END SELECT without SELECT.
10h
Expression too long or complex (too many levels of program nesting by SELECT statement.)
10-125
Page 236
PDT 1100 Terminal Programmer’s Guide
WAIT Statement Name: Wait
Type: I/O Statement
Description Pauses program execution until a designated input port presents a given bit pattern.
Syntax WAIT portnumber, ANDbyte[,XORbyte] where: portnumber = A numeric expression. ANDbyte and XORbyte = A numeric expression which returns a value from 0 to 255.
Notes WAIT suspends a user program while monitoring the input port designated by portnumber until the port presents the bit pattern given by ANDbyte and XORbyte. (Refer to Appendix D, I/O Ports)
Each bit in ANDbyte corresponds to a port bit to be turned on. Each bit in XORbyte corresponds to a port bit to be turned off. The byte at the input port is first XORed with the XORbyte parameter. Next, the result is ANDed with the value of ANDbyte parameter. If the final result is zero (0), the WAIT instruction rereads the input port and continues the same process. If it is nonzero, control passes to the statement following the WAIT. !
If XORbyte option is omitted, the WAIT instruction uses a value of zero (0). WAIT 1,x ' = WAIT 1,x,0
!
If an invalid port number or bit data is specified, zero (0) is assumed so the WAIT instruction falls into an infinite loop.
10-126
Page 237
Statement Reference
Syntax Error Error Code and Message Meaning error 71: Syntax error portnumber is missing. ANDbyte is missing.
Execution Error Error Code
Meaning
05h
Parameter out of range.
Example WAIT 0,&H03
The above instruction suspends a user program until data is entered from the keyboard or the bar code reader.
Reference Statements
OUT
Functions
INP
10-127
Page 238
PDT 1100 Terminal Programmer’s Guide
WHILE...WEND Statement Name: While ... Wend
Type: Flow Control Statement
Description Continues to execute a statement block as long as the conditional expression is true.
Syntax WHILE conditionalexpression [statementblock] WEND
Notes A WHILE...WEND continues to execute statementblock as long as the conditionalexpression is true (not zero) according to the steps below. 1. The conditionalexpression in the WHILE statement is evaluated. 2. If the condition is false (zero), the statementblock is bypassed and control passes to the first statement following the WEND. If the condition is true (not zero), the statementblock is executed. When WEND statement is encountered, control returns to the WHILE statement. (Go back to step (1).) !
! ! ! !
The WHILE and WEND statements cannot be written on a same program line. If no WEND statement is written corresponding to the WHILE, a syntax error occurs. The BASIC 3.0 does not support a DO...LOOP statement block. You can nest the WHILE...END instructions to a maximum of 10 levels.
10-128
Page 239
Statement Reference
!
When using the WHILE...WEND statement with other block-structured statements (FOR...NEXT, IF...THEN...ELSE...END IF, and SELECT...CASE...END SELECT), you can nest them up to 30 levels. WHILE a WHILE b WHILE c • • • WEND WEND WEND
Syntax Error Error Code and Message Meaning Too many nesting levels.
error 26:
error 57: Incorrect use WEND appears outside of the WHILE statement block. of WHILE...END error 58: Incomplete control structure
No WEND corresponds to WHILE.
Reference Statements
FOR...NEXT
10-129
Page 240
PDT 1100 Terminal Programmer’s Guide
XFILE Statement Name: Xfile
Type: I/O Statement
Description Transmits a designated file according to the specified communications protocol.
Syntax Syntax 1 XFILE “filename”[,“protocolspec”]
Syntax 2 XFILE “drivename:filename”[,“protocolspec”] where: “filename,” and “protocolspec,” and “drivename:filename” = String expressions.
Notes XFILE transmits a data file designated by “filename” or “drivename:filename” between the PDT 1100 and the host computer according to the communications protocol specified by “protocolspec.” For types of protocol, refer to the PDT 1100 User's Manual.
“filename” or “drivename:filename” “filename” is a data file name. For the format of data file names, refer to an OPEN statement. “protocolspec” “protocolspec” parameter can specify the following protocol specifications:
10-130