SP_REPORTER

REPORTER()

  Short:
  ------
  REPORTER() Create, modify, execute reports

  Returns:
  --------
  Nothing

  Syntax:
  -------
  REPORTER([aFieldNames,aFieldTypes,aFieldLengths])

  Description:
  ------------
  Build/modify reports based on fields in database.
  Fields in database may be specified in arrays 1-3 which are
  [aFieldNames] field names [aFieldTypes] field types and
  [aFieldLengths] field lengths. All fields are used by default.

  Reporter allows a MAJOR and MINOR group, using the
  indexes currently available and open.

  Examples:
  ---------
   example 1:

   Use Customer
   REPORTER()

   example 2:
   USE Customer
   aFieldNames := {"fname","lname","mi"}
   aFieldTypes := {"C","C","C"}
   aFieldLens  := {15,35,1}
   REPORTER(aFieldNames,aFieldTypes,aFieldLens)

  Notes:
  -------
  Reporter() reports are stored in a DBF file. See the
  index for file structures. See SLSF_REPORT() for further info on
  the name and location of this file.

  Upgrade note:
  The look and feel have changed to one more uniform
  with other SuperLib functions.

  Source:
  -------
  R_REPORT.PRG

See Also : SLSF_REPORT()

SP_QFLDSTYPE

QFLDSTYPE()

  Short:
  ------
  QFLDSTYPE() Count # of fields of a given type or types

  Returns:
  --------
  <nCount> => number of fields of the specified type(s)

  Syntax:
  -------
  QFLDSTYPE(cTypes)

  Description:
  ------------
  <cTypes> is a string containing one or more field
  type symbols

  Valid symbols are:

           C   character
           N   numeric
           L   logical
           D   date
           M   memo

  If no fields of the specified type(s) exist, 0 will
  be returned

  Examples:
  ---------
   nMemos := QFIELDSTYPE("M")   // number of memo fields
   nNums  := QFIELDSTYPE("N")   // number of numeric fields
   nNums  := QFIELDSTYPE("LD")  // number of date and logical fields

  Source:
  -------
  S_AFTYPE.PRG

See also : AFIELDSTYPE()

SP_PARSFIELD

PARSFIELD()

  Short:
  ------
  PARSFIELD() Extracts the name of the field from an expression

  Returns:
  --------
  <cField> => name of the field

  Syntax:
  -------
  PARSFIELD(cExpress)

  Description:
  ------------
  Returns the field name part of cExpress

  Examples:
  ---------
   cExpr := "CUSTOMER->LASTNAME"

   IF ISFIELD(cExpr)
     ?PARSALIAS(cExpr)  // displays CUSTOMER
     ?PARSFIELD(cExpr)  // displays LASTNAME
   ENDIF

  Warnings:
  ----------
  Does not verify if this is a valid field. Use
  ISFIELD().

  Source:
  -------
  S_FIELDS.PRG

SP_PARSALIAS

PARSALIAS()

  Short:
  ------
  PARSALIAS() Extracts the name of the alias from an expression

  Returns:
  --------
  <cAlias> => name of the alias

  Syntax:
  -------
  PARSALIAS(cExpress)

  Description:
  ------------
  Returns the ALIAS part of cExpress. If <cExpress> is
  not prefaced

  with an alias ( XXXX-> ) the current ALIAS() is
  returned.

  Examples:
  ---------
   cExpr := "CUSTOMER->LASTNAME"

   IF ISFIELD(cExpr)
     ?PARSALIAS(cExpr)  // displays CUSTOMER
     ?PARSFIELD(cExpr)  // displays LASTNAME
   ENDIF

  Warnings:
  ----------
  Does not verify if this is a valid field. Use
  ISFIELD().

  Source:
  -------
  S_FIELDS.PRG

 

 

SP_ISTHISAREA

ISTHISAREA()

  Short:
  ------
  ISTHISAREA() Determines if expression is the name of a field
  in this area

  Returns:
  --------
  <lIsThisArea> => Is the expression a field in this
  area

  Syntax:
  -------
  ISTHISAREA(cExpress)

  Description:
  ------------
  Determines if <cExpress> contains the name of a field
  in this area.

  If <cExpress> contains an alias, the area of the
  alias will be checked.

  ISTHISAREA() first calls ISFIELD() to ensure the
  expression is a field name.

  If a field in another area is passed, and no alias is
  used, False will be returned.

  Examples:
  ---------
   ISTHISAREA("LASTNAME")             // actual field,  returns .t.

   ISTHISAREA("CUSTOMER->LASTNAME")  // actual field, returns .t.

   ISTHISAREA("LEFT(LNAME,5)")        // expression, returns  .f.

   ISTHISAREA("AGENT")                //field, but in another area. Returns .f.

  Notes:
  -------
  Companion functions are ISFIELD(), ISEDITABLE(),
  PARSFIELD(), PARSALIAS(), EXPBLOCK(), WORKBLOCK()

  Source:
  -------
  S_FIELDS.PRG

 

SP_ISFIELD

ISFIELD()

  Short:
  ------
  ISFIELD() Determines if an expression is the name of a field

  Returns:
  --------
  <lIsfield> => Is the expression a field

  Syntax:
  -------
  ISFIELD(cExpress)

  Description:
  ------------
  Determines if <cExpress> contains the name of a
  field. If <cExpress> contains an alias, the area of the alias
  will be checked.

  Examples:
  ---------
   isfield( "LASTNAME" )            // actual field, returns  .t.

   isfield( "CUSTOMER->LASTNAME")   // actual field, returns  .t.

   isfield( "LEFT(LNAME,5)" )       // expression, returns .f.

  Notes:
  -------
  Companion functions are ISTHISAREA(), ISEDITABLE(),
  PARSFIELD(), PARSALIAS(), EXPBLOCK(), WORKBLOCK()

  Source:
  -------
  S_FIELDS.PRG

 

SP_GLOBREP

GLOBREP()

  Short:
  ------
  GLOBREP() Performs global selective replace of a field

  Returns:
  --------
  Nothing

  Syntax:
  -------
  GLOBREP([aFields,aDesc])

  Description:
  ------------
  Allows user to point to a field and then enter a
  replacement value for it. Replacement can be executed for all
  records, query matches, or tagged records.

  [aFields,aDesc] arrays of field names, and field
  descriptions.

  Examples:
  ---------
   If nChoice == 9   // Global replace

     GLOBREP()

   endif

  Warnings:
  ----------
  These changes are, of course, permanent.
  New to 3.5:
  -Preview (view changes before they happen)
  -'Build Formula' replacement option type. Lets user build a
  formula for replacing the target field.

  Source:
  -------
  S_GLOBR.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_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

 

SP_FIELDTYPEX

FIELDTYPEX()

  Short:
  ------
  FIELDTYPEX() Returns type of field

  Returns:
  --------
  <cType> => field TYPE

  Syntax:
  -------
  FIELDTYPEX(expField)

  Description:
  ------------
  <expField> is either the numeric position of the
  field in the database, or the name of the field.

  Examples:
  ---------
   IF FIELDTYPEX(i) =="N"
     nSum += fieldget(i)
   ENDIF

  Notes:
  -------
  Just using VALTYPE(FIELDGET(n)) is fine, except that
  memo fields then show as type "C". Not always wanted.

  Source:
  -------
  S_FIELDS.PRG