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

SP_PRNTFRML

PRNTFRML()

  Short:
  ------
  PRNTFRML() Prints a formletter created by formletr()

  Returns:
  --------
  Nothing

  Syntax:
  -------
  PRNTFRML(cForm,[nPageWidth],[nLeftMargin])

  Description:
  ------------
  Prints the form <cForm> from FORMS.DBF with a
  pagewidth of [nPageWidth] and a left margin of [nLeftMargin]

  <cForm> is normally the contents of the template stored in FORMS.DBF
  (previous documentation refered to this parameter as the NAME of the
  form, which is incorrect.

  Examples:
  ---------
  This is used internally by FORMLETR() and FASTFORM().
  Refer to its usage there.

  SELECT 0
  USE FORM
  locate for descript = "MY FORM LETTER" // find letter
  cForm = form->memo_orig      // load contents
  USE
  SELECT MYDBF
  PRNTFRML(cForm,79)


  Source:
  -------
  S_PRNTF.PRG


 

 

SP_PRNT

PRNT()

  Short:
  ------
  PRNT() Writes a string of a given color at row, column

  Returns:
  --------
  Nothing

  Syntax:
  -------
  PRNT(nRow, nColumn, cString, nColor)

  Description:
  ------------
  <nRow>       row

  <nColumn>    column

  <cString>    string

  <nColor>     color attribute

  Examples:
  ---------
   PRNT(10,10,"Hello there",47)  // +W/G

  Notes:
  -------
  Here mainly for compatibility with older version. Was
  previously a C function.

  Source:
  -------
  S_PRNT.PRG

 

 

SP_NBR2STR

 NBR2STR()

  Short:
  ------
  NBR2STR() Correctly orders numerics where negative

  Returns:
  --------
  String

  Syntax:
  -------
  NBR2STR(nNumber)

  Description:
  ------------
  Ensure numeric fields are correctly ordered when
  converting to type character and when taking negatives into account.

  This is done by attaching CR, DB or CZ to the end of
  the number to overcome the placement of (-+) in the ASCII scale.

  Examples:
  ---------
   index on LASTNAME+NBR2STR(amount_due) to NEWINDEX

  Source:
  -------
  S_NBR2ST.PRG

 

 

SP_LJUST

LJUST()

  Short:
  ------
  LJUST() Left justifies a string

  Returns:
  --------
  <cJustified> => string left justified

  Syntax:
  -------
  LJUST(cTarget)

  Description:
  ------------
  Left justifies <cTarget>

  Examples:
  ---------
   string = "      Superfunction"

   string = LJUST(string)

   // (returns "Superfunction    "

  Source:
  -------
  S_LJUST.PRG

 

SP_GENVAL

GENVAL()

  Short:
  ------
  GENVAL() Generic VALID clause validation with message

  Returns:
  --------
  <lValid> => logical result of passed condition

  Syntax:
  -------
  GENVAL(expValid,expMessage)

  Description:
  ------------
  Evaluates <expValid>, which is either a bode block or
  a string to be macro expanded, as a logical value. If result is
  False, displays message <expMessage> and waits for a keypress.
  <expMessage> can be a single string, or an array of strings (see
  aMsg() ).

  Examples:
  ---------
   if genval("fcount() < 60",'Too many fields')
       COPY TO TEMP
   endif

   * ...or as a VALID CLAUSE macro'd

   @10,10 get lname VALID ;
     GENVAL("!empty(lname)","Need a last name")

   * ...or as a VALID CLAUSE eval'd

   @10,10 get fname VALID ;
     GENVAL( { || !empty(fname) },"Need a last name")

  Source:
  -------
  S_GENVA.PRG

 

SP_FULLDIR

FULLDIR()

  Short:
  ------
  FULLDIR() Interactively navigate directories

  Returns:
  --------
  <lSelected> => Directory was selected

  Syntax:
  -------
  FULLDIR([lChange],[@cDirName])

  Description:
  ------------
  Interactively navigates directories on the current
  drive.

  Allows reading of a file ( with FILEREAD() ) in a
  directory.

  If file is DBF, does a DBEDIT browse (watch your
  memory..)

  [lChange]    True - change to selected directory
               False - don't change to selected directory
               Default is True - change

  [@cDirName] Char string passed by reference, will
  contain name of selected directory on return.

  Examples:
  ---------
   cNewDir := ""

   if FULLDIR(.F.,@cNewDir)
       SET DEFAULT TO (cNewDir)
       ?"New directory is:"
       ?Curdir()
   endif

   if FULLDIR(.t.)
       ?"New directory is:"
       ?Curdir()
   endif

  Source:
  -------
  S_FULLD.PRG

 

SP_EVALQ

EVALQ()

  Short:
  ------
  EVALQ() Evaluates a logical condition in a string

  Returns:
  --------
  <lTrue> => result of evaluating condition

  Syntax:
  -------
  EVALQ(cCondition)

  Description:
  ------------
  Macro expands <cCondition> and returns logical result

  Examples:
  ---------
   locate for evalq( sls_query() )

  Notes:
  -------
  In Clipper 5.01, you're better off doing
       bQueryblock := &("{||"+sls_query()+"}")
       locate for eval(bQueryblock)

  You'll get close to a 100% speed improvement.

  Source:
  -------
  S_EVALQ.PRG

 

SP_ENDSWITH

ENDSWITH()

  Short:
  ------
  ENDSWITH() Determines if a string ends with another string

  Returns:
  --------
  <lEndsWith> => True or False, string 2 ends with
  string 1

  Syntax:
  -------
  ENDSWITH(cTarget,cEndsWith)

  Description:
  ------------
  Determines if string 1 <cTarget> ends with string 2
  <cEndsWith>

  Examples:
  ---------
   cStr1    = "SUPERFUNCTION"
   cStr2    = "FUNCTION"
   cStr3    = "FUNKY"
   ENDSWITH(cStr1,cStr2)  //returns .t.
   ENDSWITH(cStr1,cStr3)     //returns .f.

  Source:
  -------
  S_ENDSW.PRG