SP_PROGON

PROGON()

  Short:
  ------
  PROGON() Initialize and display a progress bar box

  Returns:
  --------
  Nil

  Syntax:
  -------
  PROGON([cMessage])

  Description:
  ------------
  Places a progress box on the screen for use by
  PROGDISP()

  [cMessage] is an optional box title

  Examples:
  ---------

   //--------- this just shows progress from 1 - 1000
   initsup()
   ProgOn("Test")
   for i = 1 to 1000
     ProgDisp(i,1000,{||alltrim(str(i))+" of 1000"} )
   next
   ProgOff()

   //-------- this show indexing progress
   use Customer
   ProgOn("Index")
   dbcreateindex("Eraseme","(LNAME)",  ;
    {||ProgDisp( recno(),recc() ),LNAME},.f.)
   ProgOff()

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

See also : PROGCOUNT(), PROGDISP(), PROGEVAL(), PROGINDEX(), PROGOFF()

SP_PROGOFF

PROGOFF()

  Short:
  ------
  PROGOFF() Removes a progress bar box created by PROGON()

  Returns:
  --------
  Nil

  Syntax:
  -------
  PROGOFF()

  Description:
  ------------
  Removes the progress box placed on the screen by
  PROGON()

  Examples:
  ---------

   //---------- this just shows progress from 1 - 1000
   initsup()
   ProgOn("Test")
   for i = 1 to 1000
     ProgDisp(i,1000,{||alltrim(str(i))+" of 1000"} )
   next
   ProgOff()

   //---------- this shows indexing progress
   use Customer
   ProgOn("Index")
   dbcreateindex("Eraseme","(LNAME)",  ;
    {||ProgDisp( recno(),recc() ),LNAME},.f.)
   ProgOff()

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

See also : PROGCOUNT(), PROGDISP(), PROGEVAL(), PROGINDEX(), PROGON()

SP_PROGINDEX

PROGINDEX()

  Short:
  ------
  PROGINDEX() Perform an index with a progress box

  Returns:
  --------
  Nil

  Syntax:
  -------
  PROGINDEX(cName,cKey,[lUnique],[lShowCount],[lPause])

  Description:
  ------------
  Pops up a progress bar box with PROGON().

  Performs an index using <cName> as the index name,
  and <cKey> as the index key.

  [lUnique] for index UNIQUE (default False)

  [lShowCount] to show an index count as well as the
  progress bar - default False

  [lPause] if True will pause before removing the box
  with PROGOFF()- default is False.

  Examples:
  ---------

   use customer
   ProgIndex("Eraseme","LNAME",.f.,.t.,.t.)

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

See also : PROGCOUNT(), PROGDISP(), PROGEVAL(), PROGOFF(), PROGON()

SP_PROGEVAL

PROGEVAL()

  Short:
  ------
  PROGEVAL() Perform a Database DBEVAL() with a progress box

  Returns:
  --------
  Nil

  Syntax:
  -------
  PROGEVAL(bBlock,expCondit,[cMessage],[bMessage],[lPause])

  Description:
  ------------
  Pops up a progress bar box with PROGON().

  Performs a DBEVAL() using <bBlock> as the first
  parameter, and <expCondit> as the FOR condition. (can be
  passed as a codeblock or a string).

  [cMessage] is an optional box title for the progress
  box

  [bMessage] is a codeblock which returns a string
  which will be displayed on the bottom inside line of the progress
  box for each record processed.

  [lPause] if True will pause before removing the box
  with PROGOFF()- default is False.

  Examples:
  ---------

   // here is a counting example
   nCount   := 0
   nScanned := 0
   bDisplay := {||alltrim(str(nCount))+" matches of "+;
                  alltrim(str(nScanned++))+" scanned"}
   ProgEval({||++nCount},"[S]$LNAME","Counting",bDisplay,.t.)

   // OR
   ProgEval({||++nCount},{||"S"$LNAME},"Counting",bDisplay,.t.)

  Notes:
  -------
  Look up on DBEVAL() and note that this function is
  the same, except it uses only the first two parameters.

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

See also : PROGCOUNT(), PROGDISP(), PROGINDEX(), PROGOFF(), PROGON()

SP_PROGDISP

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()

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

See also : PROGCOUNT(), PROGEVAL(), PROGINDEX(), PROGOFF(), PROGON()

SP_PROGCOUNT

PROGCOUNT()

  Short:
  ------
  PROGCOUNT() Perform a count with a progress box

  Returns:
  --------
  Nil

  Syntax:
  -------
  PROGCOUNT(expCondit,[cMessage],[lPause])

  Description:
  ------------
  Pops up a progress bar box with PROGON().
  Performs a COUNT on the current DBF using
  <expCondit> as the FOR condition. (can be passed as a
  codeblock or a string).

  [cMessage] is an optional box title for the progress
  box

  [lPause] if True will pause before removing the box
  with PROGOFF()- default is False.

  Examples:
  ---------

   use customer

   ProgCount("[S]$LNAME")
   ProgCount({||"S"$LNAME},"Counting",.t.)

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

See also : PROGDISP(), PROGEVAL(), PROGINDEX(), PROGOFF(), PROGON()