The text of a manual · part 30 of 47
PDT 1100 Terminal Programmer's Guide: Chapter 10 Statement Reference, pages 271 to 280
Pages 271 to 280 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 271
Function Reference
Execution Error Error code
Meaning
05h
Parameter out of range (areaspec is out of range.)
0Fh
String length out of range (stringexpression is more than a single byte.)
11-23
Page 272
PDT 1100 Terminal Programmer’s Guide
HEX$ Function Name: HEXadecimal
Type: String Function
Description Converts a decimal number into the equivalent hexadecimal string.
Syntax HEX$(numericexpression)
where: numericexpression = A numeric expression which returns a value from
-32,768 to 32,767.
Notes HEX$ function converts a decimal number from -32768 to 32767 into the equivalent hexadecimal string which is expressed with 0 to 9 and A toF.
Listed below are conversion examples. numericexpression Returned value
-32,768 8000 -1 FFFF 0 0 1 1 32,767 7FFF
Execution Error Error code
Meaning
06h
The operation result is out of allowable range.
11-24
Page 273
Function Reference
INKEY$ Function Name: INput KEYboard
Type: I/O Function
Description Returns a character read from the keyboard.
Syntax INKEY$
Notes INKEY$ reads from the keyboard to see whether a key has been pressed, and returns one character read. If no key has been pressed, INKEY$ returns a null string. (For the character codes, refer to Appendix C, Character Sets. For the key number assignment, refer to Appendix E, Key Number Assignment on the Keyboard.) !
INKEY$ does not echo back a read character on the LCD screen.
!
A common use for INKEY$ is to monitor a keystroke while the PDT 1100 is ready for bar code reading or other events. If any key previously specified for keystroke trapping is pressed, INKEY$ cannot return the typed data since the INKEY$ has lower priority than keystroke trapping. To display the cursor, use the LOCATE and CURSOR statements as shown below.
!
!
LOCATE,,1:CURSOR ON k$=INKEY$ IF k$=“k”“ THEN...
Reference Statements
CURSOR, LOCATE, KEY ON, and KEY OFF
Functions
ASC and INPUT$
11-25
Page 274
PDT 1100 Terminal Programmer’s Guide
INP Function Name: INput data
Type: I/O Function
Description Returns a byte read from a specified input port.
Syntax INP(portnumber)
where: portnumber = A numeric expression which returns a value from 0 to
32,767.
Notes INP reads one-byte data from an input port specified by portnumber and returns the value. (For the input port numbers, refer to Appendix D, I/O Ports.) It also reads the battery voltage level. !
Listed below are effective port numbers. 0, 3, 4, 8 10h to 24Fh Eh, Fh 6010h, 6011h, 6040h, 6060h, 6061h, 6062h, 6070h, 6080h
!
If you specify an invalid value to portnumber, INP returns an indeterminate value.
11-26
Page 275
Function Reference
Execution Error Error code
Meaning
05h
Parameter out of range (portnumber is out of range.)
Reference Statements
OUT and WAIT
11-27
Page 276
PDT 1100 Terminal Programmer’s Guide
INPUT$ Function Name: INPUT file
Type: File I/O Function
Description Returns a specified number of characters read from the keyboard or from a device file.
Syntax Syntax 1 (Reading from the keyboard) INPUT$(numcharas)
Syntax 2 (Reading from a device file) INPUT$(numcharas,[#] filenumber)
where: numcharas = A numeric expression which returns a value from 1 to 255. filenumber = A numeric expression which returns a value from 1 to 16.
Notes INPUT$ reads the number of characters specified by numcharas from the keyboard or from a device file specified by filenumber, then returns the resulting string.
Syntax 1 (without specification of filenumber) INPUT$ reads a string or control codes from the keyboard. !
INPUT$ does not echo back read characters on the LCD screen.
!
The cursor shape (invisible, underlined, or full block) depends upon the specification selected by the LOCATE statement. If any key previously specified for keystroke trapping is pressed during execution of the INPUT$, the keyboard input will be ignored; that is, neither typed data is read by INPUT$ nor keystroke is trapped.
!
11-28
Page 277
Function Reference
Syntax 2 (with specification of filenumber) INPUT$ reads from a device file (the bar code device file or any of the communications device files). !
Use the LOC function to indicate the number of characters in a device file.
Execution Error Error code
Meaning
05h
Parameter out of range ( numcharas is out of range.)
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 range.
Reference Statements
CURSOR, INPUT, LINE INPUT, LOCATE, OPEN “BAR:”, and OPEN “COM:”
Functions
EOF, INKEY$, LOC, and LOF
11-29
Page 278
PDT 1100 Terminal Programmer’s Guide
INSTR Function Name: IN STRing
Type: String Function
Description Searches a specified target string for a specified search string, and then returns the position where the search string is found.
Syntax INSTR([startposition,] targetstring, searchstring)
where: startposition = A numeric expression which returns a value from 1 to
32,767. targetstring and searchstring = A string expression.
Notes INSTR searches a target string specified by targetstring for a search string specified by searchstring, and then returns the first character position of the search string first found. !
startposition is the character position where the search is to begin in targetstring. If you omit startposition option, the search begins at the first character of targetstring.
!
targetstring is the string being searched.
!
searchstring is the string you are looking for.
!
Do not mistake the description order of targetstring and searchstring. A returned value of INSTR is a decimal number from 0 to 255, depending upon the following conditions.
!
11-30
Page 279
Function Reference
Conditions If searchstring is found within targetstring:
Returned value First character position of the search string first found
If startposition is greater than the length 0 of targetstring or 255: If targetstring is a null string:
0
If searchstring is not found:
0
If searchstring is a null string:
Value of startposition 1 if startposition option is omitted.
Execution Error Error code
Meaning
05h
Parameter out of range ( startposition is out of range.)
Reference Functions
LEN
11-31
Page 280
PDT 1100 Terminal Programmer’s Guide
INT Function Name: INTeger
Type: Numeric Operation Function
Description Returns the largest whole number less than or equal to the value of a given numeric expression.
Syntax INT(numericexpression)
where: numericexpression = A real expression.
Notes INT returns the largest whole number less than or equal to the value of numericexpression by stripping off the fractional part. !
Use INT as shown below to round off the fractional part of a realnumber. INT(realnumber+0.5)
Example:
!
dat=1.5 PRINT INT(dat+0.5) 2
If numericexpression is negative, this function operates as shown below. PRINT INT(-1.5) PRINT INT(-0.2) -2 -1
11-32