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>sbsetpos() scroll bar function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  SBSETPOS()                                             Scroll Bar Function
 Purpose..: Update the scroll bar thumb character
-------------------------------------------------------------------------------
 Syntax...: sbSetPos( <aSBar>, <nVal> ) --> NIL

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

            <nVal>      = the new value with which to update the
                          thumb character of the scroll bar. It should be
                          an absolute value. As an example, if you have
                          set up a scroll bar for moving through a DBF file,
                          you should use recno() to update sbSetPos().

 Returns..: NIL

 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.

                aVertSB := sbNew( SB_VSCROLL )
                sbChrThumb( aVertSB, "." )
                sbChrBar  ( aVertSB, "#" )
                sbChrDec  ( aVertSB, "." )
                sbChrInc  ( aVertSB, "." )
                sbClrSpec ( aVertSB, "W+/B, B/*W, W+/B" )
                sbSetRange( aVertSB, 1, lastrec() - nScrLength + 1 )
                ...
                sbSetPos  ( aVertSB, recno() )
                ...

See Also: sbNew() sbWhere() sbSetRange()

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