SP_TRUEVAL

TRUEVAL()

  Short:
  ------
  TRUEVAL() Returns val of ALL numerics in a string

  Returns:
  --------
  <nValue> => all numerics value

  Syntax:
  -------
  TRUEVAL(cString)

  Description:
  ------------
  Removes all non-numeric characters from a <cString>,
  and then converts it to numeric.

  Examples:
  ---------
   cString := "SUPERFUNCTION Library version 3.00"

   cNumber := TRUEVAL(cString)

   // (returns 3.0)

  Source:
  -------
  S_TRUEVA.PRG

 

SP_TODOLIST

TODOLIST()

  Short:
  ------
  TODOLIST() Simple todo list manager

  Returns:
  --------
  Nothing

  Syntax:
  -------
  TODOLIST()

  Description:
  ------------
  Pops up a simple TODO list interface,allowing the  user to enter in things 
  'To do' by Description, Category, Priority and Date Due. These categories 
   may be sorted, filtered and printed.

  Examples:
  ---------
   TODOLIST()

  Source:
  -------
  S_TODO.PRG

 

SP_TIMEPER

TIMEPER()

  Short:
  ------
  TIMEPER() Time Period (date sensitive) DBF analysis

  Returns:
  --------
  Nothing

  Syntax:
  -------
  TIMEPER([aFields,aDescript],[aIndexes])

  Description:
  ------------
  Does a menu-driven time/date sensitive analysis of a
  DBF based on DATE type fields in the DBF, by sorting data into
  time periods

  Time periods can be:

       A By Week
       B Week to Date
       C By Month
       D Month to Date
       E By Year
       F Year to date
       G User defined

  Additional numeric fields may be tallied within each
  time period.

  [aFields]   array of field names

  [aDescript] array of field descriptions

  [aIndexes]  array of currently open indexes for
  re-opening on exit

  Examples:
  ---------
   TIMEPER(aFields,aDesc,aIndexes)

  Warnings:
  ----------
  Restore your indexes after using this function, as it
  creates a new index and you will lose the SET INDEX...unless you
  pass the third param as an array of open indexes

  Source:
  -------
  S_TIME.PRG


SP_TAGMARRAY

TAGMARRAY()

  Short:
  ------
  TAGMARRAY() Tag elements in muti-dimensioned array

  Returns:
  --------
  <aTagged> => an array of numbers representing the
  tagged elements

  Syntax:
  -------
  TAGMARRAY(aArray,[cTitle],[cMark],[aTags],[aHeads])

  Description:
  ------------
  A popup which allows tagging/untagging of elements in
  <aArray>, which is a multi-dimmed array of the format
  {array(n),array(n)} such as is returned by DIRECTORY() or DBSTRUCT().

    SPACE   = Tag/Untag
    F10     = Done
    ESC     = Abort
    ALT-A   = Tag All
    ALT-U   = Untag All
    ALT-S   = Swap Tagged/untagged

  The return value <aTagged> is an array of integer
  values representing the offsets into the original array <aArray> which
  were tagged.

  [cTitle] is a string to be used as the box title

  [cMark]  is the tag character. Default is chr(251) - checkmark

  [aTags]  is an array of logicals the same length as
  <aArray>. This allows pre-tagging. You may also use this
  array on return from the function. The (.T.) elements
  correspond to the tagged elements in <aArray>.

  [aHeads] is an array for the column titles for each
  subarray element in <aArray>, and needs to be the same length
  as a subarray of <aArray>

  Examples:
  ---------
   aDir  := directory()

   aCols := {"File","Size","Date","Time","Attribute"}

   aCopy := tagmarray(aDir,"Select Files for copying",nil,nil,aCols)

   for i = 1 to len(aCopy)

     COPY FILE (aDir[aCopy[i],1 ]) TO (cDestination)

   next

  Notes:
  -------
  Coded by Matthew Maier - thanks.

  Source:
  -------
  S_TAGAM.PRG

 

SP_TAGIT

TAGIT()

  Short:
  ------
  TAGIT() Tag records in a dbf for later action

  Returns:
  --------
  <aTagged> => An array of tagged record numbers

  Syntax:
  -------
  TAGIT(aTagged,[aFields,aFieldDesc],[cTitle])

  Description:
  ------------
  <aTagged> is an array. To start, it is an empty array. It is both
  modified by reference and returned as a parameter. It
  is filled with the record numbers of tagged records. If it is not
  empty when passed in, it is presumed to be filled with already tagged
  record numbers.

  <aTagged> is always 'packed' on entry, so any empty()
  or nil elements are removed, and the length adjusted.

  [aFields,aFieldDesc] are optional arrays of field
  names and field descriptions.

  [cTitle] is an optional title for the tag popup.

  Examples:
  ---------
   aTag := {}
   tagit(aTag,nil,nil,"Tag records to copy")
   copy to temp for (ascan(aTag,recno()) > 0)

  Notes:
  -------
  There are slight differences in behavior from
  previous versions.

  Previous versions required an array of fixed length,
  and only allowed tagging up to that length. This version grows or
  shrinks the array as needed. This version will also shrink an empty
  array down to zero on startup.

  Source:
  -------
  S_TAG.PRG

 

SP_TAGARRAY

TAGARRAY()

  Short:
  ------
  TAGARRAY() Tag selected elements of an array

  Returns:
  --------
  An array containing the element numbers of the tagged
  items

  Syntax:
  -------
  TAGARRAY(aArray,[cTitle],[cMark])

  Description:
  ------------
  Tag items in <aArray>

  Optional title [cTitle] . Optional mark [cMark].

  Default title is none. Default mark is chr(251) - the
  checkmark.

  Examples:
  ---------
   aArr := {1,2,3,4,5,6,7}

   aSel := TAGARRAY(aArr,"Which Items","X")
   for i = 1 to len(aSel)
     DO_SOMETHING_WITH( aArr[ aSel[i] ] )
   next

  Source:
  -------
  S_TAGA.PRG

 

SP_SUM_AVE

SUM_AVE()

  Short:
  ------
  SUM_AVE() Interactive sum or average on a dbf field

  Returns:
  --------
  Nothing

  Syntax:
  -------
  SUM_AVE([cSumAve])

  Description:
  ------------
  Does a SUM or AVERAGE on a selected numeric field

  [csumAve] = "SUM" or "AVE". Default is "SUM"

  Examples:
  ---------
   case nChoice = 3  && sum

     SUM_AVE("SUM")

   case nChoice = 4  && average

     SUM_AVE("AVE")

  Notes:
  -------
  If sls_query() is not empty, an  optional SUM or
  AVERAGE for QUERY can be done.

  Source:
  -------
  S_SUMAV.PRG

 

SP_SUBPLUS

SUBPLUS()

  Short:
  ------
  SUBPLUS() Returns multiple substrings

  Returns:
  --------
  <cSubs> => new string from multiple substrings

  Syntax:
  -------
  SUBPLUS(cSource,<nStart1,nCount1>,...[nStart8,nCount8])

  Description:
  ------------
  Extracts from string <cSource> from position
  <nStart1> for <nCount1>

  characters, and repeats for sets
  [nStart2-nCount2...nStart8-nCount8]

  Examples:
  ---------
   cString := "PREFONTAINE"

   cGarble := SUBPLUS(cString,6,1,5,1,1,1,3,1)

   // garble  =  "NOPE"

  Source:
  -------
  S_SUBPLU.PRG

 

SP_STRPULL

STRPULL()

  Short:
  ------
  STRPULL() Extract text between 2 characters in a string

  Returns:
  --------
  <cExtract> => text extracted

  Syntax:
  -------
  STRPULL(cSource,cDelim1,cDelim2)

  Description:
  ------------
  Extracts text from <cSource> between characters
  <cDelim1> and <cDelim2>.

  If <cDelim1> is empty, uses beginning of <cSource>.

  If <cDelim2> is empty, uses end of <cSource>.

  Examples:
  ---------
   cString := "SUPERFUNCTION"

   cString := STRPULL(cString,'E','C')

   // (returns "RFUN")

  Source:
  -------
  S_STRPUL.PRG

 

SP_STRIP_PATH

STRIP_PATH()

  Short:
  ------
  STRIP_PATH() Strip path and optionally extension from a
  filespec

  Returns:
  --------
  <cFile> => file name with path and optionally
  extension stripped

  Syntax:
  -------
  STRIP_PATH(cInSpec, [lStripExt])

  Description:
  ------------
  Returns <cInSpec>, the name of a file with its path
  stripped.

  [lStripExt] if True will strip the extension as well.
  Default is false.

  Examples:
  ---------
   ?STRIP_PATH("C:\HAIRY\CRITTERS\MONKEY.DBF")
   //  => returns "MONKEY.DBF"

   ?STRIP_PATH("C:\HAIRY\CRITTERS\MONKEY.DBF",.T.)
   //  => returns "MONKEY"

  Source:
  -------
  S_STRPAT.PRG