The text of a manual · part 32 of 47
PDT 1100 Terminal Programmer's Guide: Chapter 10 Statement Reference, pages 291 to 300
Pages 291 to 300 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 291
Function Reference
POS Function Name: POSition
Type: I/O Function
Description Returns the current column number of the cursor.
Syntax POS(0)
Notes POS returns the current column number of the cursor in the current screen mode selected by a SCREEN statement.
This function returns an integer value from 1 to 17 (independently of the display font size selected) Even if the cursor is invisible (by a LOCATE statement), the POS function operates. ! If the maximum value in the current screen mode is returned, it means that the cursor stays outside of the rightmost column. ! When the small-size font is selected, a full- or half-width character occupies a screen area two times or one time as wide as a character in the single-byte ANK mode, respectively. ! (0) is a dummy parameter that can have any value or expression, but it is usually 0. For the current row number of the cursor, refer to the CSRLIN function. !
Reference Statements
LOCATE and SCREEN
Functions
CSRLIN
11-43
Page 292
PDT 1100 Terminal Programmer’s Guide
RIGHT$ Function Name: RIGHT
Type: String Function
Description Returns the specified number of rightmost characters from a given string expression.
Syntax RIGHT$(stringexpression, stringlength)
where: stringlength = A numeric expression which returns a value from 0 to
255.
Notes Starting at the right side of the string, RIGHT$ extracts a portion of a string specified by stringexpression by the number of characters specified by stringlength. ! !
If stringlength is zero, RIGHT$ 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
11-44
LEN, LEFT$, and MID$
Page 293
Function Reference
SEARCH Function Name: SEARCH
Type: File I/O Function
Description Searches a specified data file for specified data, and then returns the record number where the search data is found.
Syntax SEARCH([#] filenumber, fieldvariable, searchdata“” startrecord“” where: filenumber = A numeric expression which returns a value from 1 to
16. fieldvariable = A non-array string variable. searchdata = A string expression. startrecord = A numeric expression which returns a value from 1 to
32,767.
Notes SEARCH searches a target field specified by fieldvariable in a data file specified by filenumber for data specified by searchdata, and then returns the number of the record where the search data is found. !
fieldvariable is a string variable defined by a FIELD statement.
!
searchdata is the data you are looking for.
!
startrecord is the number of a record where the search is to begin in a data file. The search ends when all of the written records have been searched.
If you omit startrecord option, the search begins at the first record of the data file. ! !
If the search data is not found, SEARCH returns the value 0. A convenient use for SEARCH is, for example, to search for a particular product name, unit price, or stock quantity in a product master file by specifying a bar code data to searchdata. 11-45
Page 294
PDT 1100 Terminal Programmer’s Guide
!
Since the search begins at a record specified by startrecord in a data file and finishes at the last record, sort records in the data file in the order of frequency of use before executing of this function to increase searching speed.
Execution Error Error code
Meaning
05h
Parameter out of range.
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
FIELD, GET, and OPEN
Functions
LOF
11-46
Page 295
Function Reference
SOH$ Function Name: Start Of Heading
Type: I/O Function
Description Modifies the value of a header (SOH) for the PDT 1100 protocol; also returns the current value of a header.
Syntax Syntax 1 (Changing the value of a header) SOH$= stringexpression
Syntax 2 (Returning the current value of a header) SOH$ where: stringexpression = A string expression which returns a single-byte character.
Notes Syntax 1 SOH$ modifies the value of a header (one of the text control characters) which indicates the start of heading 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.) !
SOH$ is a protocol function.
!
The initial value of a header ( SOH) is 01h.
Syntax 2 SOH$ returns the current value of a header.
11-47
Page 296
PDT 1100 Terminal Programmer’s Guide
Execution Error Error code
Meaning
0Fh
String length out of range (stringexpression is more than a single byte.)
Reference Statements
XFILE and OPEN “COM:”
Functions
ETX$ and STX$
11-48
Page 297
Function Reference
STR$ Function Name: STRing
Type: String Function
Description Converts the value of a numeric expression into a string.
Syntax STR$(numericexpression)
where: numericexpression = A numeric expression.
Notes STR$ converts the value of numericexpression into a string. !
If numericexpression is 0 or positive, STR$ adds a leading space as shown below. PRINT STR$(123);LEN(STR$(123)) 123 4
To delete the leading space, use the MID$ function as shown below. PRINT MID$(STR$(123),2);LEN(STR$(123)) 123 4 !
If numericexpression is negative, STR$ adds a minus sign as shown below. PRINT STR$(-456);LEN(STR$(-456)) -456 4
! !
Use STR$ to write numeric data into a data file. The VAL function has the opposite capability to STR$.
11-49
Page 298
Ze ia PDT 1100 Terminal Programmer's Guide
~F
Reference
Functions VAL
11-50
Page 299
Function Reference
STX$ Function Name: Start of TeXt
Type: I/O Function
Description Modifies the value of a header (STX) for the PDT 1100 protocol; also returns the current value of a header.
Syntax Syntax 1 (Changing the value of a header) STX$= stringexpression
Syntax 2 (Returning the current value of a header) STX$ where: stringexpression = A string expression which returns a single-byte character.
Notes Syntax 1 STX$ modifies the value of a header (one of the text control characters) which indicates the start 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.) !
STX$ is called a protocol function.
!
The initial value of a header ( STX) is 02h.
Syntax 2 STX$ returns the current value of a header.
11-51
Page 300
PDT 1100 Terminal Programmer’s Guide
Execution Error Error code
Meaning
0Fh
String length out of range (stringexpression is more than a single byte.)
Reference Statements
XFILE and OPEN “COM:”
Functions
ETX$ and SOH$
11-52