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 24 of 47

PDT 1100 Terminal Programmer's Guide: Chapter 10 Statement Reference, pages 211 to 220

Pages 211 to 220 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 211

Statement Reference

POWER Statement Name: Power

Type: I/O Statement

Description Controls the automatic power-off facility.

Syntax Syntax 1 (Turning off the power according to the power-off counter) POWER counter

Syntax 2 (Turning off the power immediately) POWER {OFF|0}

Syntax 3 (Disabling the automatic power-off facility) POWER CONT where: counter = A numeric expression which returns a value from 0 to 32,767.

Notes POWER counter turns off the power after the length of time specified by counter. !

counter is the value in seconds of the power-off. Following is a sample program for turning off power 4800 seconds after execution of POWER instruction. POWER 4800

! !

If no POWER instruction is issued, the default counter value is 180 seconds. If any of the following occurs while the power-off counter is counting, the counter is reset to the preset value and starts counting again: " Any key is pressed. " The trigger switch is pressed.

10-101

Page 212

PDT 1100 Terminal Programmer’s Guide

"

The PDT 1100 sends or receives data via a communications device file. (If a communications device file is closed, this operation does not reset the power-off counter.) Execution of POWER OFF or POWER 0 immediately turns off the power. The execution of POWER OFF or POWER 0 deactivates the resume function if preset. POWER CONT disables the automatic power-off facility. !

Execution Error Error Code

Meaning

05h

Parameter out of range (counter is out of range.)

10-102

Page 213

Statement Reference

PRINT Statement Name: Print

Type: I/O Statement

Description Displays data on the LCD screen.

Syntax PRINT [data[CR/LFcontrol...]] where: data = A numeric or string expression. CR/LFcontrol = A comma (,) or a semicolon (;).

Notes PRINT displays a number or a character string specified by data at the current cursor position on the LCD and repositions the cursor according to CR/LFcontrol. To position the cursor, use a LOCATE statement. data may be displayed in any mode. Select the screen mode using a SCREEN statement before execution of the PRINT instruction.

If you specify single-byte ANK characters for data after using a SCREEN statement to select the two-byte Kanji mode or condensed two-byte Kanji mode, the ANK characters appear in the half-width size. CLS SCREEN 1 ' - - Kanji mode PRINT “ABC123” SCREEN 0 ' - - ANK mode PRINT “DEF456”

These statements produce this output:

10-103

Page 214

PDT 1100 Terminal Programmer’s Guide

A B C 1 2 3 DEF456 !

!

! !

data may be displayed in standard size or small size depending upon the display font size selected. If you omit data option, a blank line outputs (the cursor moves to the first column of the next screen line). Positive numbers and zero display with a leading space. Control codes (08h to 1Fh) appear as a space, except for BS (08h, CR(0Dh) and C (18h) codes. BS (08h) deletes the character preceding the cursor to move the cursor backwards by one column: PRINT CHR$(8);

CR (0Dh) causes a carriage return which moves the cursor to the first column of the next screen line: PRINT CHR$(&h0D);

C (18h) clears the LCD screen which moves the cursor to its home position in the top left corner: PRINT CHR$(&h18);

CR/LFcontrol determines where the cursor is to be positioned after the PRINT instruction executes.

If CR/LFcontrol is a comma (,), the cursor moves to the column position of a least multiple of 8 plus one following the last character output. Statement example:

PRINT 123,

Output:

_123____-

If CR/LFcontrol is a semicolon (;), the cursor moves to the column position immediately following the last character output. Statement example:

PRINT 123;

Output:

123-

If neither a comma (,) nor semicolon (;) is specified to CR/LFcontrol, the cursor moves to the first column on the next screen line.

10-104

Page 215

Statement Reference

Statement example:

PRINT 123

Output:

123 _

In the above cases, the screen scrolls up so the cursor is always visible on the LCD screen. To extend one program line to more than 512 characters in a single PRINT statement, use an underline (_) preceding a CR code instead of a comma (,).

Syntax Error Error Code and Message Meaning error 71: Syntax error data contains a comma (,) or semicolon (;).

Reference Statements

LOCATE, SCREEN, and PRINT USING

10-105

Page 216

PDT 1100 Terminal Programmer’s Guide

PRINT # Statement Name: Print #

Type: File I/O Statement

Description Outputs data to a communications device file.

Syntax PRINT # filenumber[, data[CR/LFcontrol...]] where: filenumber = A numeric expression which returns a value from 1 to

16. data = A numeric or string expression. CR/LFcontrol = A comma (,) or a semicolon (;).

Notes PRINT # outputs a numeric value or a character string specified by data to a communications device file specified by filenumber. filenumber is a communications device file number assigned when the file is opened. CR/LFcontrol !

If CR/LFcontrol is a comma (,), the PRINT # instruction pads data with spaces so the number of data bytes becomes a least multiple of 8 before outputting the data. PRINT #1,“ABC”,“123” Statement example: Output:

!

ABC_ _ _ _ _123 CR LF (“_” denotes a space.)

If CR/LFcontrol is a semicolon (;), the PRINT # instruction outputs data without adding spaces or control codes. PRINT #1,“ABC”;“123”; Statement example: Output:

10-106

ABC123

Page 217

Statement Reference

!

If neither a comma (,) nor semicolon (;) is specified to CR/LFcontrol, the PRINT # instruction adds CR and LF codes. PRINT #1,“ABC123” Statement example: Output:

ABC123 CR LF

To extend one program line to more than 512 characters in a single PRINT# statement, use an underline (_) preceding a CR code, instead of a comma (,).

Syntax Error Error Code and Message Meaning error 71: Syntax error filenumber is missing. data contains a comma (,) or semicolon (;).

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

3Ah

File number out of range.

Reference Statements

OPEN

10-107

Page 218

PDT 1100 Terminal Programmer’s Guide

PRINT USING Statement Name: Print Using

Type: I/O Statement

Description Displays data on the LCD screen under formatting control.

Syntax Syntax 1 (Displaying numbers) PRINT USING “numericformat”; expression[CR/LFcontrol [expression]...]

Syntax 2 (Displaying strings) PRINT USING “stringformat”; stringexpression[CR/LFcontrol [stringexpression]...] where: numericformat = #, a decimal point (.), and/or +. stringformat = !, @, and/or & CR/LFcontrol = A comma (,) or a semicolon (;).

Notes PRINT USING displays a number or a character string specified by expression or stringexpression on the LCD according to a format specified by numericformat or stringformat, respectively.

To extend one program line to more than 512 characters in a single PRINT USING statement, use an underline (_) preceding a CR code, instead of a comma (,). numericformat is a formatting string consisting of #, decimal point (.), and/or +, each of which causes a special printing effect as described below. #

Represents a digit position. If the number specified by expression has fewer digits than the number of digit positions specified by #, it is padded with spaces and right-justified.

10-108

Page 219

Statement Reference

Statement example:

PRINT USING “#####”;123

Output:

123

If the number specified by expression has more digits than the number of digit positions specified by #, the extra digits before the decimal point are truncated and those after the decimal point are rounded.

.

Statement example:

PRINT USING “###.#”;1234.56

Output:

234.6

Specifies the position of the decimal point. If the number specified by expression has fewer digits than the number of digit positions specified by # after the decimal point, the insufficient digits appear as zeros.

+

Statement example:

PRINT USING “####.###”;123

Output:

123.000

Displays the sign of the number. If + is at the beginning of the format string, the sign appears before the number specified by expression; if + is at the end of the format string, the sign appears after the number. If the number specified by expression is a positive number or zero, it is preceded or followed by a space instead of a sign. Statement example:

PRINT USING “+#####”;-123

Output:

-123 stringformat is a formatting string consisting of !, @, and/or &&, each of which causes a special printing effect as described below. !

@

Displays the first character of the stringexpression. Statement example:

PRINT USING “!”;“ABC”

Output:

A

Displays the entire stringexpression. Statement example:

PRINT USING “@”;“ABC”

Output:

ABC

10-109

Page 220

PDT 1100 Terminal Programmer’s Guide

&& Displays the first n+2 characters of the stringexpression, where n is the number of spaces between the ampersands ( & &).

If the format field specified by stringformat is longer than the stringexpression, the string is left-justified and padded with space; if it is shorter, the extra characters are truncated. Statement example:

PRINT USING “& &”;“ABCDE”

Output:

ABCDE

Below are statement examples containing incorrect formatting strings. Example:

PRINT USING “Answer=###”;a

Example:

PRINT USING “####.# ######”;a,b expression or stringexpression

If more than one number or string is specified, the PRINT USING instruction displays each of them according to numericformat or stringformat, respectively. PRINT USING “###”;a,b,c

CR/LFcontrol CR/LFcontrol determines where the cursor is to be positioned after the PRINT USING instruction executes. For details, refer to the CR/LFcontrol in the PRINT statement.

Syntax Error Error Code and Message Meaning error 71: Syntax error numericformat is missing. expression or stringexpression contains a comma (,) or semicolon (;). error 86: ';' missing

10-110

No semicolon (;) follows “numericformat” or “string-format”.