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

PDT 1100 Terminal Programmer's Guide: Chapter 10 Statement Reference, pages 281 to 290

Pages 281 to 290 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 281

Function Reference

LEFT$ Function Name: LEFT

Type: String Function

Description Returns the specified number of leftmost characters from a given string expression.

Syntax LEFT$(stringexpression, stringlength)

where: stringlength = A numeric expression which returns a value from 0 to

255.

Notes LEFT$ extracts a portion of a string specified by stringexpression by the number of characters specified by stringlength, starting at the left side of the string. ! !

If stringlength is zero, LEFT$ returns a null string. If stringlength is greater than the length of stringexpression, the whole stringexpression is returned.

Execution Error Error code

Meaning

05h

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

Reference Functions

LEN, MID$, and RIGHT$

11-33

Page 282

PDT 1100 Terminal Programmer’s Guide

LEN Function Name: LENgth

Type: String Function

Description Returns the length (number of bytes) of a given string.

Syntax LEN(stringexpression)

Notes LEN returns the length of stringexpression, that is, the number of bytes in the range from 0 to 255. !

11-34

If stringexpression is a null string, LEN returns the value 0.

Page 283

Function Reference

LOC Function Name: LOcation Counter of file

Type: File I/O Function

Description Returns the current position within a specified file.

Syntax LOC([#] filenumber)

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

Notes LOC returns the current position within a file (a data file, communications device file, or bar code device file) specified by filenumber. !

Depending upon the file type, the content of the returned value differs as listed below. File type

Returned value

Data file

Record number following the number of the last record read by a GET statement.

Communications device file

Number of characters contained in the receive buffer (0 if no data is present in the receive buffer.)

Bar code device file

Number of characters contained in the bar code buffer* (0 if the PDT 1100 is waiting for bar code reading.) * The size of the bar code buffer is 99 bytes.

!

If LOC is used before execution of the first GET instruction after a data file is opened, it returns 1 or 0 when the data file has any data or no data, respectively.

11-35

Page 284

PDT 1100 Terminal Programmer’s Guide

Execution Error Error code

Meaning

34h

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

3Ah

File number out of range.

3Eh

A PUT or GET instruction executed without a FIELD instruction (no FIELD instruction is found.)

Reference Statements

OPEN

Functions

EOF and LOF

11-36

Page 285

Function Reference

LOF Function Name: Location Of file

Type: File I/O Function

Description Returns the length of a specified file.

Syntax LOF([#] filenumber)

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

Notes LOF returns the length of a data file or communications device file specified by filenumber. !

Depending upon the file type, the content of the returned value differs as listed below. File type

Returned value

Data file

Number of written records

Communications device file

Number of bytes of unoccupied area in the receive buffer

!

If you specify the bar code device file, an execution error occurs.

11-37

Page 286

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 bar code device file specified.)

3Ah

File number out of range

3Eh

A PUT or GET instruction executed without a FIELD instruction (no FIELD instruction is found.)

Reference Statements

GET, INPUT, LINE INPUT, LOCATE, OPEN , and OPEN “COM:”

Functions

EOF, INPUT$, and LOC

11-38

Page 287

Function Reference

MARK$ Function Name: code MARK

Type: I/O Function

Description Returns a bar code type and the number of digits of the bar code.

Syntax MARK$

Notes MARK$ returns a 3-byte string which consists of the first one byte representing a bar code type and the remaining two bytes indicating the number of digits of the bar code. !

The first one byte of a returned value contains one of the following letters representing bar code types: Bar code type

!

First one byte of a returned value

EAN-13 or UPC-A

A

EAN-8

B

UPC-E

C

ITF (Interleaved 2 of 5)

I

STF (Standard 2 of 5)

H

NW7 (Codabar)

N

Code 39

M

Code 93

L

Code 128

K

EAN128

W

The remaining two bytes of a returned value indicate the number of digits of the bar code in decimal notation.

11-39

Page 288

PDT 1100 Terminal Programmer’s Guide

!

11-40

MARK$ returns a null string until bar code reading takes place first after start of the program.

Page 289

Function Reference

MID$ Function Name: MIDdle

Type: String Function

Description Returns a portion of a given string expression from anywhere in the string.

Syntax MID$(stringexpression, startposition[,stringlength])

where: startposition = A numeric expression which returns a value from 1 to

255. stringlength = A numeric expression which returns a value from 0 to

255.

Notes Starting from a position specified by startposition, MID$ extracts a portion of a string specified by stringexpression, by the number of characters specified by stringlength. !

A returned value of MID$ depends upon the conditions as listed below. Conditions

If stringlength option is omitted:

Returned value All characters from startposition to the end of the string Example:

PRINT MID$(“ABC123”,3) C123

11-41

Page 290

PDT 1100 Terminal Programmer’s Guide

If stringlength is greater than the number All characters from startposition to the end of characters contained between of the string startposition and the end of the string: PRINT MID$(“ABC123”,3,10) Example: C123

If startposition is greater than the length Null string of stringexpression: Example:

PRINT MID$(“ABC123”,10,1)

Note: BASIC 3.0 does not support such MID$ function that replaces a part of a string variable.

Execution Error Error code

Meaning

05h

Parameter out of range

Reference Functions

11-42

LEFT$, LEN, and RIGHT$