SP Expression Functions

 FIELDLENX()    Returns length of field
 EXPBLOCK()     Returns a codeblock to evaluate an expresson
 FIELDTYPEX()   Returns type of field
 FIELDPOSX()    Returns position of field named in expression
 FIELDDECX()    Returns decimals of field
 PARSFIELD()    Exracts the name of the field from an expression
 BLANKREC()     Blanks out a record
 PARSALIAS()    Exracts the name of the alias from an expression
 WORKBLOCK()    Returns a set-get block for field named in an expression
 BLANKFIELD()   Returns a blank value corresponding to a field
 ISBLANKREC()   Determines if a record is blank
 ISFIELD()      Determines if an expression is the name of a field
 ISTHISAREA()   Determines if expression is the name of a field in this area

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