Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FreshWin (c) Fresh Technologies - <b>sbwhere() scroll bar function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  SBWHERE()                                              Scroll Bar Function
 Purpose..: Return the relative position in the scroll bar
-------------------------------------------------------------------------------
 Syntax...: sbWhere( <aSBar> ) --> nRelPos

 Arguments: <aSBar>     = scroll bar structure returned via
                          a call to sbNew().

 Returns..: <N> nRelPos is the relative position in the scroll bar.

 Source...: SCRLBAR.PRG
-------------------------------------------------------------------------------
 Example..: . The example creates a new vertical
              scroll bar structure, changes the thumb character,
              the bar fill character, the decrement control character,
              the increment control character and the color specification.

              To this, we add the appropriate range for scroll
              a DBF file. The screen length is taken from the record
              total to keep a blank screen from being displayed when the
              bottom of the file is hit. Then we print out which array
              element is referred to by the scroll bar.

                aVertSB := sbNew( SB_VSCROLL )
                sbChrThumb( aVertSB, "." )
                sbChrBar  ( aVertSB, "#" )
                sbChrDec  ( aVertSB, "." )
                sbChrInc  ( aVertSB, "." )
                sbClrSpec ( aVertSB, "W+/B, B/*W, W+/B" )
                sbSetRange( aVertSB, 1, len( aArray ) - nScrLength + 1 )
                ...
                sbSetPos  ( aVertSB, aArray[ nI ] )
                ? aArray[ sbWhere( aVertSB ) ]
                ...

See Also: sbNew() sbSetPos() sbPos()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson