SP_FORMULATE

FORMULATE()

  Short:
  ------
  FORMULATE() Builds a free-form formula or User Defined Field

  Returns:
  --------
  <cFormula> => String containing formula

  Syntax:
  -------
  FORMULATE([cInFormula],[aFields], [aFDesc], [cDisplay],[cTypes] )

  Description:
  ------------
  Allows ad hoc creation of formulas (expressions) by mixing freeform
  text, function templates and operators.

  [cInFormula] Optional character string containing the formula to
               modify
  [aFields]    Optional list of dbf field names
  [aFDesc ]    Optional list of alternate names for dbf field names
  [cDisplay]   Optional text for the prompt. Default is :
               "Create Formula/User Defined field:"
  [cTypes]     Optional string containing allowed return types (in caps)
               Default is "CDNL" (char, date, numeric, logical)

  Examples:
  ---------

  1. cExpress := FORMULATE("",nil,nil,"Create logical expression","L")

  2.(taken from FORMLETR() )

    cAddExpress := FORMULATE(aEdit[nThisLine],aFieldNames,aFieldDesc,;
       "Modify Label Contents (must result in type CHARACTER):",;
       "C")

  Notes:
  -------

  Source:
  -------
  S_FORMU.PRG

 

SP_FORMLETR

FORMLETR()

  Short:
  ------
  FORMLETR() Interactive formletter and mailmerge utility

  Returns:
  --------
  Nothing

  Syntax:
  -------
  FORMLETTER([aNames,aDesc,aTypes];
        [aMoreFuncs,aMoreDesc,aMoreHot])

  Description:
  ------------
  Provides a menu driven interface to the creation,
  modification and merging/printing of form letters with DBFs.

  Three field arrays may be passed - [aNames] is an
  array of allowable field names, [aDesc] is an array of
  field descriptions, and [aTypes] is an array of field types. All
  fields are used as a default, with field names being the default
  field descriptions. Pass all or none of the first three arrays.

  Three additional arrays may be passed for up to 30
  additional hotkeys.

  [aMoreFuncs] is an array of functions which will be
  placed between .. delimiters. [aMoreDesc] is a corresponding
  descriptive array of these functions, to be shown when the user
  presses F1. Format:

       "hotkey     description "
        | column 1 |column 17

  [aMoreHot] is the corresponding hotkeys as their
  numeric ascii values.

  All three arrays must be passed, if any, and all must
  be of same length with no null or undefined elements.

  You could use these for Printer control, special
  combined fields, etc. Be sure the functions you wish to call are
  available to the linker, usually by declaring them EXTERNAL.

  Examples:
  ---------

  USE CUSTOMER

  aFields := {"Fname","lname","mi"}
  aDesc   := {"First","Last","Middle"}
  aTypes  := {"C","C","C"}

  * hotkey arrays
  aMoreFuncs := {"BOLD_ON()","BOLD_OFF"}

  aMoreDesc  := {"F5    BOLD PRINT ON", "F6    BOLD PRINT OFF"}
  aMoreKeys  := {K_F5,K_F6}

  FORMLETR(aFields,aDesc,aTypes,  ;
             aMoreFuncs,aMoreDesc,aMoreKeys)

  //or...

  USE CUSTOMER
  FORMLETR()

  Notes:
  -------
  See index for notes on using a different file name
  for FORM.DBF

  Source:
  -------
  S_FORML.PRG

 

SP_FMOVE2PRIOR

FMOVE2PRIOR()

  Short:
  ------
  FMOVE2PRIOR() Moves to beginning of previous CRLF delimited
  line in a text file

  Returns:
  --------
  <lSuccess> => for success

  Syntax:
  -------
  FMOVE2PRIOR(nHandle)

  Description:
  ------------
  Moves pointer in a text file <nHandle> opened with
  FREAD() to the beginning if the next CRLF delimited line in the
  file. Returns .f. if unable to.

  Examples:
  ---------
   FMOVE2PRIOR(handle)

   ?FREADLINE(handle)

  Source:
  -------
  S_FM2P.PRG

 

SP_FMOVE2NEXT

FMOVE2NEXT()

  Short:
  ------
  FMOVE2NEXT() Move to beginning of next line in a text file

  Returns:
  --------
  <lSuccess> => success in doing so

  Syntax:
  -------
  FMOVE2NEXT(nHandle)

  Description:
  ------------
  Moves pointer in text file <nHandle> to beginning of
  next line.

  Presuming lines end in CRLF. Returns <expL> for
  success. End of file would return .f.

  Examples:
  ---------

   // this will list off the text file REPORT.LST to the  screen

   h := fopen("report.lst")
   ?SFREADLINE(h)
   while  FMOVE2NEXT(h)
    ?SFREADLINE(h)
   end

  Source:
  -------
  S_FM2N.PRG

 

SP_FILLARR

FILLARR()

  Short:
  ------
  FILLARR() Fill type, length, decimal arrays

  Returns:
  --------
  Nothing - works on arrays passed

  Syntax:
  -------
  FILLARR(aNames,aTypes,[aLens],[aDeci])

  Description:
  ------------
  Fills in TYPE <aTypes> , LENGTH [aLens] and DECIMAL
  [aDeci] arrays given a FIELDNAME array <aNames>.

  Arrays (3 and 4) are optional.

  Examples:
  ---------
   nFields   :=LEN(aFieldNames)
   aFldtypes     := array(nFields)
   aFldLens      := array(nFields)
   aFldDeci      := array(nFields)
   FILLAR(aFieldNames,aFldTypes,aFldLens,aFldDeci)

  Warnings:
  ----------
  Macro expands an expression to obtain type-could
  crash if expression passed is invalid. Not really meant for
  expressions, but people will pass them from time to time.

  Notes:
  -------
  In most circumstances you would fill all of these
  arrays with one call to AFIELDS(), but there are exceptions.

  Source:
  -------
  S_FILLAR.PRG