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

     FIRSTROW(<nFirstNewLine>) --> nFirstOldLine

 Argument

     <nFirstNewLine>  Designates which line is displayed as the top line
     on the virtual screen.

 Returns

     If the parameter is passed, the function returns the previous setting
     each time.  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
     line that you would like to have visible at the top 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: SETMAXROW() MAXROW() FIRSTCOL()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson