The text of a manual · part 24 of 37
JANUS PSK for Basic, Version 2.1 Reference Manual, pages 231 to 240
Pages 231 to 240 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 231
imIrlK – Visual Basic
3
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
The InString parameter is the input string. You must allocate at least 256 bytes for InString. 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 imSetInputMode. You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter.
3-65
Page 232
imIrlK – Visual Basic
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: ’im20vbas.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
3-66
’ Just a placeholder
Page 233
imIrlK – Visual Basic
3
PRINT "Input>>"; status% = (TimeOut, (VARPTR(LengthTable(1).entry), VARSEG(LengthTable(1).entry), SSEGADD(DataMask$), VARPTR(inString), VARSEG(inString), VARPTR(cmdCount%),VARSEG(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
3-67
Page 234
imIrlN – Visual Basic 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: ’im20vbas.bi’ FUNCTION ImIrlN% (Timeout, VARPTR(TestTable), VARSEG(TestTable), VARPTR(InString), VARSEG(InString), VARPTR(CmdCount), VARSEG(CmdCount) VARPTR(Symb), VARSEG(Symb))
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 32,767 ms 32,768 to 65,534 ms imZeroTimeout imInfiniteTimeout
Integer range See “Setting Timeout Values” in this chapter. No wait Wait forever
If imInfiniteTimeout is selected, the function will not return until the end of message character has been received.
3-68
Page 235
imIrlN – Visual Basic
3
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}, 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). Any unused table entries must be set to {imNoLength,0,0,0}. OUT Parameters:
The InString parameter is the input string. You must allocate at least 256 bytes for InString. The CmdCount returned is 0 unless an abort command is passed in the string.
3-69
Page 236
imIrlN – Visual Basic
The Symb 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:
You must set the reader to Programmer mode with imSetInputMode. 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:
3-70 imIrlA, imIrlK, imIrlV, imIrlY, imSetInputMode
Page 237
imIrlN – Visual Basic
3
Example ’**************** imIrlN *************************** ’ $INCLUDE: ’im20vbas.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
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 ’ ’ LengthTable(3).entry = imNoLength ’ LengthTable(3).min = 0 ’ LengthTable(3).max = 0 ’ LengthTable(3).match = 0 ’
3-71
Page 238
imIrlN – Visual Basic
’ ’ ’ ’ ’ ’ ’ ’ ’
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% = imIrlN(TimeOut, (VARPTR(LengthTable(1).entry), VARSEG(LengthTable(1).entry), VARPTR(inString), VARSEG(inString), VARPTR(cmdCount%),VARSEG(cmdCount%), VARPTR(Symbology%) VARSEG(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
3-72
Page 239
imIrlV – Visual Basic
3 imIrlV Purpose:
This function receives input from any specified source in the same manner as the IRL universal input command V. For more information on IRL and command V, refer to the IRL Programming Reference Manual.
Syntax:
REM $INCLUDE: ’im20vbas.bi’ FUNCTION ImIrlV% (Timeout, Edit, Beeper, Display, VARPTR(Source), VARSEG(Source), VARPTR(InString), VARSEG(InString), VARPTR(CmdCount), VARSEG(CmdCount), VARPTR(Symb), VARSEG(Symb))
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 32,767 ms 32,768 to 65,534 ms imZeroTimeout imInfiniteTimeout
Integer range See “Setting Timeout Values” in this chapter. No wait Wait forever
If imInfiniteTimeout is selected, the function will not return until the end of message character has been received. If imInfiniteTimeout is selected, the function will not return until the end of message character has been received. The Edit parameter determines whether the Reader Wedge parses reader commands. Use one of these constants: imDisable imEnable
Disable reader command parsing Enable reader command parsing
If Edit is imDisabled, reader commands are treated as data.
3-73
Page 240
imIrlV – Visual Basic
The Beeper parameter determines whether the IRL V command beeps or not when data is entered. Use one of these constants: imAppliBeep imWedgeBeep
Application controls the beep Beeps each time data is entered
The Display parameter determines if the data is displayed when it is entered. Use one of these constants: imDisable imEnable IN/OUT Parameters:
Disable display of data Enable display of data
The Source parameter determines which input sources are allowed. When the IRL V command returns, Source indicates where the data came from. When both keypad and label inputs are allowed, the Source always returns keypad because it is possible for keyed and scanned data to be intermixed (not likely, but possible). If you have both the keypad and scanner enabled, and you want to know where the data came from, first check the symbology: • If the symbology is imUnknownDecode, then the data is from the keypad. • If the symbology is one of the other values (such as imCode39), then some or all of the data came from the scanner. The Source parameter is one of these constants: imNoSelect imLabelSelect imKeyboardSelect imCom1Select imCom2Select imCom4Select imAllSelect
OUT Parameters:
No source Label Keypad COM1 COM2, scanner port selected (2010 and 2050) COM4 (RF only) All sources are designated
The InString parameter is the input string. You must allocate at least 256 bytes for InString. The CmdCount is 0 unless an abort command is passed in the string.
3-74