The text of a manual · part 17 of 37
JANUS PSK for Basic, Version 2.1 Reference Manual, pages 161 to 170
Pages 161 to 170 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 161
imViewportMove – QuickBasic
2
For example, for the normal video mode 3 (80 x 25 display) with a 20 x 16 display size, the maximum value of Row is 9 (25 minus 16) and the maximum value of Column is 60 (80 minus 20). The Row and Column viewport settings are set to the maximum allowed for the current mode and display size. To determine the actual values set, check the returned values of Row and Column. This function has no effect on the JANUS 2050. See Also:
imViewportEnd, imViewportHome, imViewportPageDown, imViewportPageUp, imViewportToCursor, imCursorToViewport
Example '**************** imViewportMove ******************* REM $INCLUDE: 'im20bas1.bi' ' Viewport move ' Prompt for direction, distance INPUT "Enter direction ", direction% INPUT "Enter distance ",distance% status% = imViewportMove (direction%, distance%, dpRow%, dpColumn%) PRINT "RVP move status = " PRINT " ", HEX$(status%) PRINT "Row ", dpRow% PRINT "Col ", dpColumn% SLEEP 5 END
2-135
Page 162
imViewportPageDown – QuickBasic imViewportPageDown Purpose:
This function moves the viewport down one viewport length.
Syntax:
REM $INCLUDE: 'im20bas1.bi' SUB imViewportPageDown CDECL ()
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
None.
Notes:
This function has no effect on the JANUS 2050.
See Also:
imCursorToViewport, imViewportEnd, imViewportHome, imViewportPageUp, imViewportToCursor, imViewportMove
Example '**************** imViewportPageDown *************** REM $INCLUDE: 'im20bas1.bi' ' Down one viewport length imViewportPageDown SLEEP 5 END
2-136
Page 163
imViewportPageUp – QuickBasic
2 imViewportPageUp Purpose:
This function moves the viewport up one viewport length.
Syntax:
REM $INCLUDE: 'im20bas1.bi' SUB imViewportPageUp CDECL ()
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
None.
Notes:
This function has no effect on the JANUS 2050.
See Also:
imCursorToViewport, imViewportEnd, imViewportHome, imViewportPageDown, imViewportToCursor, imViewportMove
Example '**************** imViewportPageUp ***************** REM $INCLUDE: 'im20bas1.bi' ' Up one viewport length imViewportPageUp SLEEP 5 END
2-137
Page 164
imViewportSetxy – QuickBasic imViewportSetxy Purpose:
This function sets the viewport row and column to a specific value when moving between two screens.
Syntax:
REM $INCLUDE: 'im20bas1.bi' FUNCTION imViewportSetxy% CDECL (Row AS INTEGER, Column AS INTEGER)
IN/OUT Parameters:
The Row parameter sets the row value (Y-coordinate) of the viewport.
Return Value:
This function returns one of the standard status codes defined in Appendix A, “Status Codes.”
Notes:
The (Row, Column) pair represents the upper left corner of the viewport being displayed.
The Column parameter sets the column value (X-coordinate) of the viewport.
The minimum value for both the Row and Column is (0,0), which is the upper left corner of the virtual window. The maximum value is determined by the video mode and the number of lines and columns displayed. For example, for the normal video mode 3 (80 x 25 display) with a 20 x 16 display size, the maximum value of Row is 9 (25 minus 16) and the maximum value of Column is 60 (80 minus 20). The Row and Column viewport settings are set to the maximum allowed for the current mode and display size. To determine the actual values set, check the returned values of Row and Column. This function has no effect on the JANUS 2050. See Also:
2-138 imViewportMove
Page 165
imViewportSetxy – QuickBasic
2
Example '**************** imViewportSetxy ****************** REM $INCLUDE: 'im20bas1.bi' ' Viewport Set X and Y coordinates ' Prompt for row and col INPUT "Enter row ", dpRow% INPUT "Enter column ", dpColumn% status% = imViewportSetxy (dpRow%, dpColumn%) temp$ = INPUT$(1) PRINT "VP Set XY status =" PRINT " ", HEX$(status%) SLEEP 5 END
2-139
Page 166
imViewportToCursor – QuickBasic imViewportToCursor Purpose:
This function centers the viewport around the cursor.
Syntax:
REM $INCLUDE: 'im20bas1.bi' SUB imViewportToCursor CDECL ()
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
None.
Notes:
When the cursor is not displayed, use this function to move the viewport to the cursor. This function has no effect on the JANUS 2050.
See Also:
imCursorToViewport, imViewportEnd, imViewportHome, imViewportPageDown, imViewportMove
Example '**************** imViewportToCursor *************** REM $INCLUDE: 'im20bas1.bi' ' Call viewport to cursor imViewportToCursor SLEEP 5 END
2-140
Page 167
nugget code39 helconital
3 Visual Basic Library
Page 168
nugget code39 helconital
Page 169
Visual Basic Library
3
This chapter describes how to write applications in Visual Basic using the PSK library functions.
Working With Visual Basic The PSK Visual Basic functions are derived from the C and QuickBasic language functions.Visual Basic and QuickBasic are very similar, but the following differences affect how you write your programs: Variable Addresses Visual Basic works more like C/C++ than like QuickBasic in the way that it stores variables. Because Visual Basic uses far pointers, you compile your Visual Basic programs with IM20VBAS.BI. “Using Variable Addresses in Visual Basic” later in this section explains how Visual Basic passes variable addresses. Integers for Timeout Parameters All of the Visual Basic functions that pass a Timeout parameter pass it as an integer. In most cases, this convention causes no problem. However, as an integer, Timeout must be less than 32,768. “Setting Timeout Values” later in this section provides a solution for using larger values. Scanner Input Because Visual Basic is event driven, your application may need to handle events that the JANUS reader or Visual Basic does not recognize. For example, if your application uses a form that receives input from the bar code scanner, you need to provide a method for triggering a keyboard event. “Handling Bar Code Scanner Input” later in this section provides one possible solution. Power Management For the JANUS power management software to go to low-power mode, the keyboard buffer must be polled more frequently than Visual Basic polls it. You need to provide a method for increasing the number of keyboard polls if you want the reader to shut off when it is inactive. “Providing Power Management Support” later in this section provides one possible solution.
3-3
Page 170
JANUS PSK for Basic Reference Manual
Using Variable Addresses in Visual Basic Visual Basic uses far pointers for many variables, while QuickBasic uses only near pointers. Some of the QuickBasic library functions may work with short Visual Basic programs, but functions that pass variable parameters do not usually work as expected. To avoid problems, use the Visual Basic functions and the include file IM20VBAS.BI. Link your program with IM20_BAS.LIB. The function declarations in IM20VBAS.BI use both the address segment and offset (where appropriate) to pass variables. The rule of thumb is to use SSEGADD() for variable length strings and to use both VARPTR() and VARSEG() for fixed length strings, integers, and arrays. The order of VARPTR() and VARSEG() is important. The example in the Visual Basic for DOS Reference Manual for VARPTR states the following: Because CDECL puts things on the stack from right to left, place the offset VARPTR(xxx) first in the list, followed by the segment VARSEG(xxx) (where xxx is the variable). For example: REM $INCLUDE: ’im20vbas.bi’ FUNCTION imGetControlKey% (VARPTR(CtrlKey%), VARSEG(CtrlKey%)) '* more statements * FUNCTION ImCommand%(SSEGADD(Command$), Length%)
3-4