The text of a manual · part 14 of 37
JANUS PSK for Basic, Version 2.1 Reference Manual, pages 131 to 140
Pages 131 to 140 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 131
imSetContrast – QuickBasic
2 imSetContrast Purpose:
This function sets the reader’s LCD display contrast level. There are eight levels of contrast (0 to 7) from very light to very dark, which are the most frequently used contrast settings.
Syntax:
REM $INCLUDE: 'im20bas1.bi' FUNCTION imSetContrast% CDECL (BYVAL DisplayContrastLevel AS INTEGER)
IN Parameters:
The DisplayContrastLevel parameter is one of these constants: imMinContrast imAveContrast imMaxContrast
Level 0 Level 4 Level 7
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
The functions imSetContrast and imGetContrast use a scale of 0 to 7 that is related to the scale of 0 to 31 used by imIncreaseContrast and imDecreaseContrast. The following table compares the two scales. This Value on Scale 0 to 7
Equates to This Value on Scale 0 to 31
Contrast Level
0 1 2 3 4 5 6 7
10 12 14 16 18 20 22 24
Very light
Very dark
This function has no effect on the JANUS 2050. See Also:
imGetContrast, imDecreaseContrast, imIncreaseContrast
2-105
Page 132
imSetContrast – QuickBasic
Example '**************** imSetContrast ******************** REM $INCLUDE: 'im20bas1.bi' ' Set contrast ' Prompt for contrast level to set PRINT "Enter Contrast(0-7)" INPUT "Level = ", level% status% = imSetContrast (level%) PRINT "Set Contrast status =", HEX$(status%) END
2-106
Page 133
imSetControlKey – QuickBasic
2 imSetControlKey Purpose:
This function enables or disables the Ctrl key setting. When disabled, none of the key combinations that use the Ctrl key work. For example, the warm boot key sequence Ctrl-Alt-Del will not work.
Syntax:
REM $INCLUDE: 'im20bas1.bi' FUNCTION imSetControlKey% CDECL (BYVAL ControlKey AS INTEGER)
IN Parameters:
The ControlKey parameter is one of these constants: imEnable imDisable
Enable the Ctrl key Disable the Ctrl key
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
See Also:
imGetControlKey
Example See example for imGetControlKey.
2-107
Page 134
imSetDisplayMode – QuickBasic imSetDisplayMode Purpose:
This function sets the size mode, video mode, scroll mode, and character height of the display.
Syntax:
REM $INCLUDE: 'im20bas1.bi' FUNCTION imSetDisplayMode% CDECL (BYVAL SizeMode AS INTEGER, BYVAL VideoMode AS INTEGER, BYVAL ScrollMode AS INTEGER, BYVAL CharHt AS INTEGER)
IN Parameters:
The SizeMode parameter is one of these constants: imSizeMode80X25 imSizeMode40X25 imSizeMode 20X16 imSizeMode 20X8 imSizeMode 10X16 imSizeMode 10X8
80 x 25 text mode 40 x 25 text mode (2010 and 2020) 20 x 16 text mode (2010 and 2020) 20 x 8 text mode (2010 and 2020) 10 x 16 text mode (2010 and 2020) 10 x 8 text mode (2010 and 2020)
The VideoMode parameter is only significant if the SizeMode parameter is imSizeMode80X25. The standard BIOS goes up to VideoMode 13H, but the JANUS readers only support up to VideoMode 6. The VideoMode parameter is one of these constants: imStdVideoMode0 imStdVideoMode1 imStdVideoMode2 imStdVideoMode3 imStdVideoMode4 imStdVideoMode5 imStdVideoMode6
2-108
40 x 25 (use for double-wide characters) 40 x 25 (use for double-wide characters) 80 x 25 80 x 25 300 x 200 2-color 300 x 200 monochrome 640 x 200 2-color (2050)
Page 135
imSetDisplayMode – QuickBasic
2
The ScrollMode parameter is only significant if the size mode parameter is imSizeMode80X25. The ScrollMode parameter is one of these constants: imLcdScrollAt25 imLcdScrollAt16 imLcdScrollAt13 imLcdScrollAt8 imMaxScrollMode
Scroll at line 25 Scroll at line 16 (2010 and 2020) Scroll at line 13 (2050) Scroll at line 8 (2010 and 2020) Maximum number of scroll lines
The CharHt parameter is only significant if the SizeMode parameter is imSizeMode80X25. The CharHt parameter is one of these constants: imStandardCharHeight imDoubleCharHeight
Standard-height characters Double-height characters
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
Changing display modes clears the screen. The IRL input commands do not display correctly when the display is in 80 x 25 mode and the cursor has scrolled off the display. To alleviate this problem, set the display mode to one of the other modes, such as 20 x 16. The mode does not change if there are conflicting parameters, such as trying to set the VideoMode to 16 lines and the ScrollMode at line 8. If you want to use one of the graphics modes, use the appropriate function call provided by your programming language. You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter.
See Also:
imGetDisplayMode, imSetFollowCursor
2-109
Page 136
imSetDisplayMode – QuickBasic
Example 1 '**************** imSetDisplayMode ***************** REM $INCLUDE: 'im20bas1.bi' status% = imSetDisplayMode(imSizeMode20X16,VideoMode%,ScrollMode%,CharHt%) status% = imGetDisplayMode(SizeMode%,VideoMode%,ScrollMode%,CharHt%) print "Size =";SizeMode% print "Video =";VideoMode% print "Scroll =";srollMode% print "CharHt =";CharHt% input "Waiting>>",response$ status% = imSetDisplayMode(imSizeMode20X8,VideoMode%,ScrollMode%,CharHt%) status% = imGetDisplayMode(SizeMode%,VideoMode%,ScrollMode%,CharHt%) print "Size =";SizeMode% print "Video =";VideoMode% print "Scroll =";srollMode% print "CharHt =";CharHt% input "Waiting>>",response$ END
Example 2 '************************************************************************* ' FILE NAME: setdisp.bas ' DESCRIPTION: Tests various display configurations ' '************************************************************************* ' The PSK keeps track of display information through the normal BIOS ' calls. Basic, however, uses its own set of interrupts. This results ' in the reader wedge getting out of synch with standard basic print and ' input statements if a display size other than 80x25 or 40x25 is used. ' ' If one of the other display modes is desired, the application needs to ' display data by using INT 10H instead of the normal basic print ' statements. This is an example of how to do this. Note that this also ' applies to printing a prompt with the input statement. ' ' The command line to compile this program is: ' bc/o setdisp.bas ' ' The response file for linking would be: ' setdisp.obj im20bas.obj ' setdisp ' (blank line) ' im20_bas.lib vbdos.lib vbdcl10.lib ' ' RWTSR must be loaded for this program to execute. '************************************************************************* ' $INCLUDE: 'im20bas1.bi' ' $INCLUDE: 'vbdos.bi' declare sub PrintString (TextString$) dim shared inRegs as RegType, outRegs AS RegType CONST bufsize = 300 DIM inString AS STRING * bufsize cls
2-110
Page 137
imSetDisplayMode – QuickBasic
2 status% = imGetDisplayMode(SizeModeTmp%,videoModeTmp%,scrollModeTmp%,charHtTmp%) ' ' ' ' ' ' ' '
Instead of: print "Size =";sizeModeTmp% print "Video =";videoModeTmp% print "Scroll =";srollModeTmp% print "CharHt =";charHtTmp% input "Waiting>>",response$ use: PrintString "Size =" PrintString STR$(sizeModeTmp%) PrintString "\nVideo =" PrintString STR$(videoModeTmp%) PrintString "\nScroll =" PrintString STR$(scrollModeTmp%) PrintString "\nCharHt =" PrintString STR$(charHtTmp%) PrintString "\nWaiting>" status% = imReceiveInput(ImKeyboardSelect,imInfiniteTimeout,source%,VARPTR(inString)) cls status% = imSetDisplayMode(imSizeMode20X16,videoMode%,scrollMode%,charHt%) status% = imGetDisplayMode(SizeMode%,videoMode%,scrollMode%,charHt%) PrintString "Size =" PrintString STR$(sizeMode%) PrintString "\nVideo =" PrintString STR$(videoMode%) PrintString "\nScroll =" PrintString STR$(scrollMode%) PrintString "\nCharHt =" PrintString STR$(charHt%) PrintString "\nWaiting>" status% = imReceiveInput(ImKeyboardSelect,imInfiniteTimeout,source%,VARPTR(inString)) cls status% = imSetDisplayMode(imSizeMode20X8,videoMode%,scrollMode%,charHt%) status% = imGetDisplayMode(SizeMode%,videoMode%,scrollMode%,charHt%) PrintString "Size =" PrintString STR$(sizeMode%) PrintString "\nVideo =" PrintString STR$(videoMode%) PrintString "\nScroll =" PrintString STR$(scrollMode%) PrintString "\nCharHt =" PrintString STR$(charHt%) PrintString "\nWaiting>" status% = imReceiveInput(ImKeyboardSelect,imInfiniteTimeout,source%,VARPTR(inString)) cls status% = imSetDisplayMode(imSizeMode10X16,videoMode%,scrollMode%,charHt%) status% = imGetDisplayMode(SizeMode%,videoMode%,scrollMode%,charHt%) PrintString "Size =" PrintString STR$(sizeMode%) PrintString "\nVideo =" PrintString STR$(videoMode%) PrintString "\nScroll=" PrintString STR$(scrollMode%) PrintString "\nCharHt=" PrintString STR$(charHt%) PrintString "\nWaiting>" status% = imReceiveInput(ImKeyboardSelect,imInfiniteTimeout,source%,VARPTR(inString)) cls
2-111
Page 138
imSetDisplayMode – QuickBasic status% = imSetDisplayMode(imSizeMode10X8,videoMode%,scrollMode%,charHt%) status% = imGetDisplayMode(SizeMode%,videoMode%,scrollMode%,charHt%) PrintString "Size =" PrintString STR$(sizeMode%) PrintString "\nVideo =" PrintString STR$(videoMode%) PrintString "\nScroll=" PrintString STR$(scrollMode%) PrintString "\nCharHt=" PrintString STR$(charHt%) PrintString "\nWaiting>" status% = imReceiveInput(ImKeyboardSelect,imInfiniteTimeout,source%,VARPTR(inString)) cls status% = imSetDisplayMode(sizeModeTmp%,videoModeTmp%,scrollModeTmp%,charHtTmp%) status% = imGetDisplayMode(SizeMode%,videoMode%,scrollMode%,charHt%) PrintString "Size =" PrintString STR$(sizeMode%) PrintString "\nVideo =" PrintString STR$(videoMode%) PrintString "\nScroll =" PrintString STR$(scrollMode%) PrintString "\nCharHt =" PrintString STR$(charHt%) PrintString "\nWaiting>" status% = imReceiveInput(ImKeyboardSelect,imInfiniteTimeout,source%,VARPTR(inString)) END ' ******************************************************************** ' Prints a string using INT 10H ' Prints a newline when "\n" is found ' ******************************************************************** SUB PrintString(TextString$) Length% = LEN(TextString$) FOR I% = 1 to Length% IF ASC(MID$(TextString$, I%, 1)) = 92 AND ASC(MID$(TextString$, I%+1, 1)) = 110 THEN inRegs.ax = &HE0D ' Print CR inRegs.bx = &H0 INTERRUPT &H10, inRegs, outRegs inRegs.ax = &HE0A ' Print LF inRegs.bx = &H0 INTERRUPT &H10, inRegs, outRegs I% = I% + 1 ELSE inRegs.ax = &HE00 + ASC(MID$(TextString$, I%, 1)) inRegs.bx = &H0 INTERRUPT &H10, inRegs, outRegs END IF NEXT END SUB ' ******************************************************************** ' END OF FILE: setdisp.bas ' COPYRIGHT (c) 1994 INTERMEC CORPORATION, ALL RIGHTS RESERVED
2-112
Page 139
imSetFollowCursor – QuickBasic
2 imSetFollowCursor Purpose:
When the display is in 80 x 25 mode, the viewport follows the cursor as it moves. This function enables or disables the follow-the-cursor feature.
Syntax:
REM $INCLUDE: 'im20bas1.bi' FUNCTION imSetFollowCursor% CDECL (BYVAL FollowCursor AS INTEGER)
IN Parameters:
The FollowCursor parameter is one of these constants: imEnable imDisable
Enable follow-the-cursor mode Disable follow-the-cursor mode
OUT Parameters:
None.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
The display must be in 80 x 25 mode for this function to work correctly. This function has no effect on the JANUS 2050.
See Also:
imGetFollowCursor
Example '**************** imSetFollowCursor **************** REM $INCLUDE: 'im20bas1.bi' status% = imGetFollowCursor(followCursor%) PRINT "Follow is ";followCursor% status% = imSetFollowCursor(imDisable) status% = imGetFollowCursor(followCursor%) PRINT "Follow is ";followCursor% status% = imSetFollowCursor(imEnable) status% = imGetFollowCursor(followCursor%) PRINT "Follow is ";followCursor% END
2-113
Page 140
imSetInputMode – QuickBasic imSetInputMode Purpose:
This function clears the input buffers and sets the input manager to one of three modes: Wedge, Programmer, or Desktop.
Syntax:
REM $INCLUDE: 'im20bas1.bi' SUB imSetInputMode CDECL (BYVAL Mode AS INTEGER)
IN Parameters:
The Mode parameter is one of these constants: imWedge imProgrammer imDesktop
Wedge mode Programmer mode Desktop mode
OUT Parameters:
None.
Return Value:
None.
Notes:
You must install the Reader Wedge to use this function. For information on loading RWTSR.EXE, see “Runtime Requirements” earlier in this chapter. There are three different reader input modes: wedge, programmer, and desktop. These modes affect how the reader interprets and stores input. Wedge Mode Keypad and label input goes into the keyboard buffer with minimal filtering. Wedge mode is the default mode at the DOS prompt after reader services (RSERVICE.EXE) is loaded. This mode should be used when the reader is running an application that uses the Virtual Wedge. When in this mode, use standard input functions to retrieve keypad or label input. Wedge mode does not take full advantage of the reader’s power management capabilities. You will probably notice reduced battery life when in this mode compared to being in either programmer or desktop mode. For more information on power management, see Chapter 3, “Advanced Programming,” in the JANUS PSK for C/C++ Reference Manual.
2-114