[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FIRSTCOL()
 Sets the first visible column of a virtual screen
------------------------------------------------------------------------------
 Syntax

     FIRSTCOL(<nFirstNewColumn>) --> nFirstOldColumn

 Argument

     <nFirstNewColumn>  Designates which column is the first visible
     column on the left side of a virtual screen.

 Returns

     If the parameter is passed, the function returns the previous setting.
     If no parameter is passed, it returns the current setting.

 Description

     This function is important for use in setting virtual screen size in
     conjunction with SETMAXROW() and SETMAXCOL().  You can select the first
     column that you would like to be visible on the left side of the screen.
     In this way the screen can be moved in any direction.

 Note

     .  To simplify programming, values outside of the permissible
        range are automatically corrected to the maximum or minimum values
        (see example).

 Example

     The following example sets up a screen with 100 lines and 120 columns.
     To help you with screen orientation, the current column number is
     displayed at three locations on this virtual screen.  The virtual screen
     can be moved in any direction using cursor keys and PgUp and PgDn:

     SETMAXROW( 99)                        // screen with 100 lines
     SETMAXCOL(119)                        // and 120 columns
     CLEAR

     FOR nCount = 0 TO MAXROW()            // Build screen
        @ nCount, 0 SAY "Line" + NTOC(nCount, 10, 4)
        @ nCount, MAXCOL()/2 -5 SAY "Line" + NTOC(nCount, 10, 4)
        @ nCount, MAXCOL()  -10 SAY "Line" + NTOC(nCount, 10, 4)

     NEXT nCount

     @ 99, 00 SAY CENTER("This is the last line")

     nKeyVal  := 0
     DO WHILE nKeyVal <> 27
        nKeyVal  := INKEY(0)
        DO CASE
        CASE nKeyVal = 5
           FIRSTROW(FIRSTROW() -1)
        CASE nKeyVal = 24
           FIRSTROW(FIRSTROW() +1)
        CASE nKeyVal = 4
           FIRSTCOL(FIRSTCOL() +1)
        CASE nKeyVal = 19
           FIRSTCOL(FIRSTCOL() -1)
        CASE nKeyVal = 18
           FIRSTROW(FIRSTROW() -10)
        CASE nKeyVal = 3
           FIRSTROW(FIRSTROW() +10)
        ENDCASE
     ENDDO

     FIRSTROW(0)                           // reset
     FIRSTCOL(0)
     SETMAXCOL(79)
     SETMAXROW(24)
     CLEAR


See Also: SETMAXCOL() MAXCOL() FIRSTROW()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson