Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SuperLib 3.50 - function progdisp() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FUNCTION PROGDISP()

  Short:
  ------
  PROGDISP() Displays progress bar in box created with PROGON()

  <quick descrip>

  Returns:
  --------
  <expReturn> => determined by several things

  Syntax:
  -------
  PROGDISP(nCurrent,nTotal,[bMessage],[bReturn])

  Description:
  ------------
  Updates a progress bar created with PROGON().

  <nCurrent> is the current item/position. <nTotal> is
  the total items. What is displayed is the percentage <nCurrent>
  is of <nTotal>.

  [bMessage] is an optional message line block, which
  is displayed

  on the bottom inside line of the box [bReturn] is an
  optional return value, with the default being  True

  Examples:
  ---------
   //---------- this just shows progress from 1 - 1000
   initsup()
   ProgOn("Test")
   for i = 1 to 1000
     IF !ProgDisp(i,1000,{||alltrim(str(i))+" of 1000"},;
            {||inkey()#27} )
       exit
     endif
   next
   ProgOff()

   //--------- this show indexing progress
   use Customer
   ProgOn("Index")
   dbcreateindex("Eraseme","(LNAME)", ;
    {||ProgDisp( recno(),recc() ),LNAME},.f.)
   ProgOff()
   // note the use of parentheses around LNAME.
   // see also PROGINDEX()

   //--------- this shows a count progress
   nCounted := 0
   nMatches := 0
   bDisplay := {||alltrim(str(nMatches))+" matches of "+;
             alltrim(str(nCounted)) }
   ProgOn("Counting")
   count for "S"$LNAME to ;
      nMatches while ProgDisp(++nCounted,recc(),bDisplay )
   ProgOff()
   // see also PROGCOUNT()

  Source:
  -------
  S_PROG.PRG


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