The text of a manual · part 9 of 37
JANUS PSK for Basic, Version 2.1 Reference Manual, pages 81 to 90
Pages 81 to 90 of 362
The original document is the PDF (601 KB). 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 Intermec J2020, Intermec J2010 and Intermec J2050
Page 81
imIrlA – QuickBasic
2 imIrlA Purpose:
This function receives input from bar code labels or the keypad in the same manner as the IRL ASCII input command A. This function returns the input data to the buffer, edits reader commands, and displays input data. For more information on IRL and command A, refer to the IRL Programming Reference Manual.
Syntax:
REM $INCLUDE: ’im20bas1.bi’ FUNCTION ImIrlA% CDECL (BYVAL Timeout AS LONG, TestTable AS INTEGER, BYVAL MaskString AS INTEGER, BYVAL PwStringPTR AS INTEGER, CmdCount AS INTEGER, Symbology AS INTEGER)
IN Parameters:
The Timeout parameter is the receive input timeout period. You can exit the function before data is received or before the timeout occurs by performing an application break sequence (see your JANUS user’s manual). The return status indicates whether the function was successful, a timeout occurred, or the application break was received. The Timeout parameter is a number or one of these constants: 0 to 65,534 ms imZeroTimeout imInfiniteTimeout
Numeric range No wait Wait forever
If imInfiniteTimeout is selected, the function will not return until the end of message character has been received. Data is returned only if its length matches one of the five lengths specified in the TestTable. The TestTable parameter must be a matrix of the following form: {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d},
2-55
Page 82
imIrlA – QuickBasic
The a position in the matrix is one of the following: imNoLength imLength imRange
Accept data of any length Accept data with a specific length Accept data within a length range
If imLength is specified in the a position, the actual length of the data string is placed in the d position (and b and c are not used). If imRange is specified in the a position, the data length must be within the range of b and c (and d is not used). Set any unused table entries to {imNoLength,0,0,0}. The MaskString parameter sets up a data mask that received data must match. MaskString accepts a string of constants or wildcard characters. For example, use the string ### - #### to accept only phone numbers. You can use one or more of these wildcard characters to define the mask: # @ ? NULL (CHR$(0)) OUT Parameters:
Numeric Alpha Alphanumeric printable No mask
You must allocate at least 256 bytes to the PwString parameter. The CmdCount returned is 0 unless an abort command is passed in the string.
2-56
Page 83
imIrlA – QuickBasic
2
The Symbology parameter is one of these constants: imUnknownDecode imCODABAR imCode11 imCode16k imCode39 imCode49 imCode93 imCode128 imI2Of5 imMSI imPLESSEY imUPC
Unknown bar code Codebar bar code Code 11 bar code Code 16K bar code Code 39 bar code Code 93 bar code Code 49 bar code Code 128 bar code Interleaved 2 of 5 MSI bar code Plessey bar code Universal Product code
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
Set the reader to programmer mode using imSetInputMode before using this function. You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter. Data does not display correctly on the screen if the display is in the 80 x 25 mode after the cursor has scrolled off the bottom of the display. Set the display to one of the other modes using imSetDisplayMode.
See Also:
imIrlK, imIrlN, imIrlV, imIrlY, imSetDisplayMode, imSetInputMode
2-57
Page 84
imIrlA – QuickBasic
Example ’**************** imIrlA *************************** ’ $INCLUDE: ’im20bas1.bi’ DIM
LengthTable(imNumIrlLengths) AS imLengthSpec
CONST bufsize = 300 DIM inString AS STRING * bufsize CLS
’ Clear the screen imSetInputMode(imProgrammer) TimeOut = 10000
’ Set timeout to 10 seconds
’ The data mask takes precedence over other options. ’ If no data mask is wanted, just set it to CHR$(0) ’ This example would be for a Social Security number ’
DataMask$ = "###-##-####" + CHR$(0) ’ Null terminate string DataMask$ = CHR$(0) ’ No data mask
’ ’
This example shows how to set 3 lengths and 1 range. Input would need to be of length 3, 5, 7, or 11 through 15 characters. LengthTable(1).entry = imLength LengthTable(1).min = 0 LengthTable(1).max = 0 LengthTable(1).match = 3 LengthTable(2).entry = imLength LengthTable(2).min = 0 LengthTable(2).max = 0 LengthTable(2).match = 5 LengthTable(3).entry = imLength LengthTable(3).min = 0 LengthTable(3).max = 0 LengthTable(3).match = 7 LengthTable(4).entry = imRange LengthTable(4).min = 11 LengthTable(4).max = 15 LengthTable(4).match = 0 LengthTable(5).entry = imNoLength LengthTable(5).min = 0 LengthTable(5).max = 0 LengthTable(5).match = 0
’ Just a placeholder
’ This table would be used if the user wanted to enter data of any length. ’ ’ LengthTable(1).entry = imNoLength ’ LengthTable(1).min = 0 ’ LengthTable(1).max = 0 ’ LengthTable(1).match = 0 ’ ’ LengthTable(2).entry = imNoLength ’ LengthTable(2).min = 0 ’ LengthTable(2).max = 0 ’ LengthTable(2).match = 0
2-58
Page 85
imIrlA – QuickBasic
’ ’ ’ ’ ’ ’ ’ ’ ’ ’ ’ ’ ’ ’
2
LengthTable(3).entry = imNoLength LengthTable(3).min = 0 LengthTable(3).max = 0 LengthTable(3).match = 0 LengthTable(4).entry = imNoLength LengthTable(4).min = 0 LengthTable(4).max = 0 LengthTable(4).match = 0 LengthTable(5).entry = imNoLength LengthTable(5).min = 0 LengthTable(5).max = 0 LengthTable(5).match = 0 PRINT "Input>>";
status% = imIrlA(TimeOut, LengthTable(1).entry, SADD(DataMask$), VARPTR(inString), cmdCount%, Symbology%) ’ ’ ’ ’
This will get the length of the returned string by looking for the first null. Doing a LEN function will return the length of the string, but since this is a fixed-length string, the value that would be returned (in this example) would be 300. charCounter% = 1 WHILE MID$(inString, charCounter%, 1) > CHR$(0) charCounter% = charCounter% + 1 WEND charCounter% = charCounter% - 1 PRINT PRINT "Recvd>>";LEFT$(inString,charCounter%) imSetInputMode(imWedge)
END
2-59
Page 86
imIrlK – QuickBasic imIrlK Purpose:
This function receives input from the keypad in any format in the same manner as the IRL ASCII input command K. This function returns the input data to the buffer, edits reader commands, and displays input data. For more information on IRL and command K, refer to the IRL Programming Reference Manual.
Syntax:
REM $INCLUDE: ’im20bas1.bi’ FUNCTION ImIrlK% CDECL (BYVAL Timeout AS LONG, TestTable AS INTEGER, BYVAL MaskString AS INTEGER, BYVAL PwStringPTR AS INTEGER, CmdCount AS INTEGER)
IN Parameters:
The Timeout parameter is the receive input timeout period. You can exit the function before data is received or before the timeout occurs by performing an application break sequence (see your JANUS user’s manual). The return status indicates whether the function was successful, a timeout occurred, or the application break was received. The Timeout parameter is a number or one of these constants: 0 to 65,534 ms imZeroTimeout imInfiniteTimeout
Numeric range No wait Wait forever
If imInfiniteTimeout is selected, the function will not return until the end of message character has been received. Data is returned only if its length matches one of the five lengths specified in the TestTable. The TestTable parameter must be a matrix of the following form: {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d}, {a, b, c, d},
2-60
Page 87
imIrlK – QuickBasic
2
The a position in the matrix is one of the following: imNoLength imLength imRange
Accept data of any length Accept data of a specific length Accept data within a length range
If imLength is specified in the a position, the actual length of the data string is placed in the d position (and b and c are not used). If imRange is specified in the a position, the data length must be within the range of b and c (and d is not used). Set any unused table entries to {imNoLength,0,0,0}. The MaskString parameter sets up a data mask that received data must match. MaskString can accept a string of constants or wildcard characters. For example, use the string ### - #### to accept only phone numbers. You can use one or more of these wildcard characters to define the mask: # @ ? NULL (CHR$(0)) OUT Parameters:
Numeric Alpha Alphanumeric printable No mask
You must allocate at least 256 bytes to the PwString parameter. The CmdCount returned is 0 unless an abort command is passed in the string.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
You must set the reader to programmer mode with the imSetInputMode function to use this function. You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter.
2-61
Page 88
imIrlK – QuickBasic
Data does not display correctly on the screen if the display is in the 80 x 25 mode after the cursor has scrolled off the bottom of the display. Set the display to one of the other modes using imSetDisplayMode. See Also:
imIrlA, imIrlN, imIrlV, imIrlY, imSetDisplayMode, imSetInputMode
Example ’**************** imIrlK *************************** ’ $INCLUDE: ’im20bas1.bi’ DIM
LengthTable(imNumIrlLengths) AS imLengthSpec
CONST bufsize = 300 DIM inString AS STRING * bufsize CLS
’ Clear the screen imSetInputMode(imProgrammer) TimeOut = 10000
’ Set timeout to 10 seconds
’ The data mask takes precedence over other options. ’ If no data mask is wanted, just set it to CHR$(0) ’ This example would be for a Social Security number ’
DataMask$ = "###-##-####" + CHR$(0) ’ Null terminate string DataMask$ = CHR$(0) ’ No data mask
’ ’
This example shows how to set 3 lengths and 1 range. Input would need to be of length 3, 5, 7, or 11 through 15 characters. LengthTable(1).entry = imLength LengthTable(1).min = 0 LengthTable(1).max = 0 LengthTable(1).match = 3 LengthTable(2).entry = imLength LengthTable(2).min = 0 LengthTable(2).max = 0 LengthTable(2).match = 5 LengthTable(3).entry = imLength LengthTable(3).min = 0 LengthTable(3).max = 0 LengthTable(3).match = 7 LengthTable(4).entry = imRange LengthTable(4).min = 11 LengthTable(4).max = 15 LengthTable(4).match = 0 LengthTable(5).entry = imNoLength LengthTable(5).min = 0 LengthTable(5).max = 0 LengthTable(5).match = 0
2-62
’ Just a placeholder
Page 89
imIrlK – QuickBasic
2
PRINT "Input>>"; status% = imIrlK(TimeOut, LengthTable(1).entry, SADD(DataMask$), VARPTR(inString), cmdCount%) ’ ’ ’ ’
This will get the length of the returned string by looking for the first null. Doing a LEN function will return the length of the string, but since this is a fixed-length string, the value that would be returned (in this example) would be 300. charCounter% = 1 WHILE MID$(inString, charCounter%, 1) > CHR$(0) charCounter% = charCounter% + 1 WEND charCounter% = charCounter% - 1 PRINT PRINT "Recvd>>";LEFT$(inString,charCounter%) imSetInputMode(imWedge)
END
2-63
Page 90
imIrlN – QuickBasic imIrlN Purpose:
The imIrlN function receives numeric input from the keypad or a label in the same manner as the IRL numeric input command N. Nonnumeric data is ignored. This function clears any data that might be in the keyboard or label buffers before the function was called, edits reader commands from input, and displays input data. For more information on IRL and command N, refer to the IRL Programming Reference Manual.
Syntax:
REM $INCLUDE: ’im20bas1.bi’ FUNCTION ImIrlN% CDECL (BYVAL Timeout AS LONG, TestTable AS INTEGER, BYVAL PwStringPTR AS INTEGER, CmdCount AS INTEGER, Symbology AS INTEGER)
IN Parameters:
The Timeout parameter is the receive input timeout period. You can exit the function before data is received or before the timeout occurs by performing an application break sequence (see your JANUS user’s manual). The return status indicates whether the function was successful, a timeout occurred, or the application break was received. The Timeout parameter is a number or one of these constants: 0 to 65,534 ms imZeroTimeout imInfiniteTimeout
Numeric range No wait Wait forever
If imInfiniteTimeout is selected, the function will not return until the end of message character has been received.
2-64