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

PDT 1100 Terminal Programmer's Guide: Chapter 10 Statement Reference, pages 261 to 270

Pages 261 to 270 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 261

Function Reference

CSRLIN Function Name: CurSor LINe

Type: I/O Function

Description Returns the current row number of the cursor.

Syntax CSRLIN

Notes CSRLIN returns the current row number of the cursor in the current screen mode selected by a SCREEN statement as an integer.

If the current screen mode is the single-byte ANK mode, this function returns a value from 1 to 6 (when the standard-size font is selected) or from 1 to 8 (when the small-size font is selected); if it is the two-byte Kanji mode, this function returns a value from 1 to 5 (when the standard-size font is selected) or from 1 to 7 (when the small-size font is selected). ! !

Even if the cursor is invisible (by a LOCATE statement), the CSRLIN function operates. For the current column number of the cursor, refer to the POS function.

Reference Statements

LOCATE and SCREEN

Functions

POS

11-13

Page 262

PDT 1100 Terminal Programmer’s Guide

DATE$ Function Name: DATE

Type: I/O Function

Description Returns the current system date or sets a specified system date.

Syntax Syntax 1 (Retrieving the current system date) DATE$

Syntax 2 (Setting the current system date) DATE$=“date” where: date = A string expression.

Notes Syntax 1 DATE$ returns the current system date as an 8-byte string. The string has the format below. yy/ mm/ dd where yy is the lower two digits of the year from 00 to 99, mm is the month from 01 to 12, and dd is the day from 01 to 31.

Syntax 2 DATE$ sets the system date specified by “date”. The format of “date”is the same as that in syntax 1.

Example: !

11-14 date$=”90/10/12”

The year yy must be the lower two digits of the year: otherwise, the system does not compensate for leap years .

Page 263

Function Reference

!

The calendar clock is backed up by the battery. (For the system time, refer to the TIME$ function.)

Execution Error Error code

Meaning

05h

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

Reference Functions

TIME$

11-15

Page 264

PDT 1100 Terminal Programmer’s Guide

EOF Function Name: End Of File

Type: File I/O Function

Description Tests whether the end of a device I/O file has been reached.

Syntax EOF([#] filenumber)

where: filenumber = A numeric expression which returns a value from 1 to 16.

Notes EOF tests for an end of a file designated by filenumber, and returns -1 (true) if no data remains, or 0 (false) if any data remains.

File Type

Returned Value

Communications device file

-1 (true)

No data remains in the receive buffer.

0 (false)

More than one character remains in the receive buffer.

-1 (true)

No data remains in the bar code buffer.

0 (false)

Any data remains in the bar code buffer.

Bar code device file

End-of-file Condition

!

filenumber should be the file number of an opened device file.

!

The EOF function cannot be used for data files. Specifying a data file number for filenumber causes an execution error.

11-16

Page 265

Function Reference

Execution Error Error code

Meaning

34h

Bad file name or number (filenumber of an unopened file specified.)

36h

Improper file type ( filenumber of a data file specified.)

3Ah

File number out of range.

Reference Statements

INPUT#, LINE INPUT#, OPEN “BAR:”, and OPEN “COM“”

Functions

INPUT$, LOC, and LOF

11-17

Page 266

PDT 1100 Terminal Programmer’s Guide

ERL Function Name: ERror Line

Type: Error-Handling Function

Description Returns the current instruction location of the program where an execution error occurred.

Syntax ERL

Notes ERL returns the current instruction location of the program where an execution error occurred most recently. ! !

!

!

The ERL function works only with line numbers, not labels. Addresses which the ERL returns correspond to ones that are output to the left end of the address-source list in hexadecimals when a +L option is specified in compilation, if converted from decimals to hexadecimals with the HEX$ function. Since the ERL function returns a significant value only when an execution error occurs, use this function in error-handling routines where you can check the error type for effective error recovery. The returned value is in decimals, so it may be necessary to use the HEX$ function for decimal-to-hexadecimal conversion.

Reference Statements

ON ERROR GOTO and RESUME

Functions

ERR and HEX$

11-18

Page 267

Function Reference

ERR Function Name: ERror Code

Type: Error-Handling Function

Description Returns the error code of the most recent execution error.

Syntax ERR

Notes ERR returns the code of an execution error that invoked the error-handling routine. !

!

!

Codes which the ERR returns correspond to ones that are listed in Execution Errors on page A-1 if converted from decimals to hexadecimals with the HEX$ function. Since the ERR function returns a significant value only when an execution error occurs, use this function in error-handling routines to check the error type for effective error recovery. The returned value is in decimals, so it may be necessary to use the HEX$ function for decimal-to-hexadecimal conversion.

Reference Statements

ON ERROR GOTO and RESUME

Functions

ERL and HEX$

11-19

Page 268

PDT 1100 Terminal Programmer’s Guide

ETX$ Function Name: End of TeXt

Type: I/O Function

Description Modifies the value of a terminator (ETX) for the PDT 1100 protocol; also returns the current value of a terminator.

Syntax Syntax 1 (Changing the value of a terminator) ETX$= stringexpression

Syntax 2 (Returning the current value of a terminator) ETX$ where: stringexpression = A string expression which returns a single-byte character.

Notes Syntax 1 ETX$ modifies the value of a terminator (a text control character) which indicates the end of data text in the PDT 1100 protocol when a data file is transmitted by an XFILE instruction. (For the PDT 1100 protocol, refer to the PDT 1100 User's Manual.) !

ETX$ is called a protocol function.

!

The initial value of a terminator (ETX) is 03h.

Syntax 2 ETX$ returns the current value of a terminator.

11-20

Page 269

Function Reference

Execution Error Error code

Meaning

05h

Parameter out of range ( stringexpression is a null string.)

0Fh

String length out of range (stringexpression is more than a single byte.)

Reference Statements

XFILE and OPEN “COM:”

Functions

SOH$ and STX$

11-21

Page 270

PDT 1100 Terminal Programmer’s Guide

FRE Function Name: FREe area

Type: Memory Management Function

Description Returns the number of bytes available in a specified area of the memory.

Syntax FRE(areaspec)

where: areaspec = A numeric expression which returns a value from 0 to 3.

Notes FRE returns the number of bytes left unused in a memory area specified by areaspec listed below.

RAM areaspec

!

!

!

11-22

0

Array work variable area

1

File area

2

Operation stack area for the Interpreter

3

File area in the flash ROM

The file area is allocated to data files and program files in cluster units (where a cluster is equal to 4,096 bytes). The FRE function returns the total number of bytes of non-allocated clusters. (For details about a cluster, refer to Appendix F, Memory Area.) The operation stack area for the Interpreter is mainly used for numeric operations, string operations, and for calling user-defined functions. A returned value of this function is a decimal number.