Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 15 of 47

PDT 1100 Terminal Programmer's Guide: Chapter 10 Statement Reference, pages 121 to 130

Pages 121 to 130 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 121

Statement Reference

CHAIN Statement Name: Chain

Type: Flow Control Statement

Description Transfers control to another program.

Syntax

Syntax 1 CHAIN “programfilename”

Syntax 2 CHAIN “drivename: programfilename” where: “programfilename” and “drivename:programfilename” = A string expression.

Notes CHAIN transfers control to a program specified by “programfilename”. That is, it terminates the current program (first program) and closes all files being opened. Then, it initializes environments for the chained-to user program (second program) and executes it. !

“programfilename” is an executable object program compiled by the Compiler and has the extension .PD3, as shown below. The extension .PD3 cannot be omitted. CHAIN “prog1.PD3”

!

Download an executable object program (second program) to the PDT 1100 before the CHAIN instruction is executed.

!

You can pass variables from the current program to the chained-to program (second program) with the COMMON statement.

10-11

Page 122

PDT 1100 Terminal Programmer’s Guide

!

!

!

User-defined fonts loaded by the APLOAD and KPLOAD statements and the setting values assigned by the KEY statement and COUNTRY$ function remain effective in chained-to programs. The ON ERROR GOTO statement cannot trap errors (while showing the error code 07h which means “Insufficient memory space”) that occurred during initialization of chained-to programs. drivename should precede program-filename. drivename is A: or B: for the RAM or flash ROM, respectively. If drivename is omitted, the default drive A: applies.

Syntax Error Error Code and Message

Meaning error 3: “” missing

No double quote precedes or follows programfilename or drivename:programfilename.

error 71: Syntax error programfilename or drivename:programfilename is not enclosed in double quotes.

Execution Error Error Code

Meaning

02h

Syntax error (“programfilename” or “drivename:programfilename” is in incorrect syntax or the extension is not .PD3.)

07h

Insufficient memory space (the first program uses too many variables.)

35h

File not found (the file specified by “programfilename” does not exist.)

41h

File damaged.

Reference Statements

10-12

APLOAD, COMMON, and KPLOAD

Page 123

Statement Reference

CLFILE Statement Name: Clear FILE

Type: File I/O Statement

Description Erases the data stored in a data file.

Syntax CLFILE [#] filenumber where: filenumber = A numeric expression which returns a value from 1 to 16.

Notes CLFILE erases data in the data file specified by filenumber and resets the number of written records in the directory to zero. !

!

The memory area freed by CLFILE can be used for other data files or user program files. User programs can no longer refer to the erased data.

Syntax Error Error Code and Message

Meaning error 71: Syntax error filenumber is missing.

10-13

Page 124

PDT 1100 Terminal Programmer’s Guide

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 data files specified.)

3Ah

File number out of range.

43h

Not allowed to access the data in the flash ROM.

Example OPEN “master.Dat” AS #1 FIELD #1,20 AS bar$,10 AS ky$ CLFILE #1 CLOSE #1

10-14

Page 125

Statement Reference

CLOSE Statement Name: Close

Type: File I/O Statement

Description Closes file(s).

Syntax CLOSE [[#] filenumber[,[#] filenumber...]] where: filenumber = A numeric expression which returns a value from 1 to 16.

Notes CLOSE closes file(s) specified by filenumber(s). !

!

!

The file number(s) closed by the CLOSE instruction becomes available for a subsequent OPEN instruction. If no file number is specified, the CLOSE instruction closes all opened data files and device I/O files. Specifying the unopened file number does not cause an operation or execution error.

Syntax Error Error Code and Message Meaning error 71: Syntax error filenumber is missing.

10-15

Page 126

PDT 1100 Terminal Programmer’s Guide

Execution Error Error Code

Meaning

3Ah

File number out of range.

Reference Statements

10-16

END and OPEN

Page 127

Statement Reference

CLS Statement Name: CLear Screen

Type: I/O Statement

Description Clears the LCD screen.

Syntax CLS

Notes CLS clears the liquid crystal display (LCD) screen and returns the cursor to the upper left corner of the screen. !

!

The CLS instruction does not affect the screen mode or the character attribute (the normal or reversed display), but it turns off the cursor. Execution of the CLS instruction when the system status is displayed on the LCD clears the VRAM area assigned to the system status area of the LCD but does not erase the system status displayed.

10-17

Page 128

PDT 1100 Terminal Programmer’s Guide

COMMON Statement Name: Common

Type: Declartive Statement

Description Declares common variables for sharing between user programs.

Syntax COMMON commonvariable[,commonvariable...] where: commonvariable = A non-array integer variable, a non-array real variable, a non-array string variable, an array integer variable, an array real variable, or an array string variable.

Notes COMMON defines common variables for sharing them when one program chains to another. !

! !

!

!

!

!

! !

10-18

Common variables defined by COMMON are effective as long as programs chained by the CHAIN statement are running. A COMMON instruction can appear anywhere in a source program. All of the variable name, type, quantity, and definition order of the common variables used in the current program should be identical with those in the chainedto programs. If not, variables having indefinite values are passed. Up to two-dimensional array variables can be defined. You can specify a subscript ranging from 0 to 254 for an array variable. The total variable data size which can be passed between chained programs is 6 kilobytes including work variables. The size of an array data is equal to the element size multiplied by the number of elements. You can specify the maximum string length within the range from 1 to 255 to a string variable. The default length of a non-array string variable is 40. The default length of an array string variable is 20.

Page 129

Statement Reference

Syntax Error Error Code and Message Meaning error 5: Variable name redefinition

A same variable name is declared twice in a program.

error 73: Improper string length

The length of a string variable is out of the range from 1 to 255.

Execution Error Error Code

Meaning

07h

Insufficient memory space (COMMON statement defines too much data.)

Example COMMON a%,b,c$,d%(2,3),e(4),f$(5)

Reference Statements

CHAIN

10-19

Page 130

PDT 1100 Terminal Programmer’s Guide

CURSOR Statement Name: Cursor

Type: I/O Statement

Description Turns the cursor on and off.

Syntax CURSOR {ON|OFF}

Notes When a user program is initiated, the cursor is set to OFF. CURSOR ON turns on the cursor for keyboard entry operation by the INKEY$ function. CURSOR OFF turns off the cursor. !

!

!

10-20

The cursor size depends upon the screen mode (the single-byte ANK mode or twobyte Kanji mode) and the display font size (standard- size or small-size). If the standard-size font is selected, the cursor appears as 6 dots wide by 8 dots high in the single-byte ANK mode, and as 8 dots wide by 16 dots high in the two-byte Kanji mode. If the small-size font is selected, the cursor appears as 6 dots wide by 6 dots high in the single-byte ANK mode, and as 6 dots wide by 12 dots high in the twobyte Kanji mode. The cursor shape specified by the most recently executed LOCATE instruction takes effect. After execution of LOCATE ,,0 which makes the cursor invisible, the CURSOR ON instruction cannot display the cursor. Use the LOCATE statement to display the cursor.