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_OPENIND

OPENIND()

  Short:
  ------
  OPENIND() Opens an array of indexes

  Returns:
  --------
  Nothing

  Syntax:
  -------
  OPENIND(aIndexNames)

  Description:
  ------------
  Opens up the indexes named in <aIndexNames>

  Examples:
  ---------
   aIndexes := {"CUSTOMER","PRODUCT","PAYDATE"}

   OPENIND(aIndexes)

  Source:
  -------
  S_OPENIN.PRG

 

 

SP_ONE_READ

ONE_READ()

  Short:
  ------
  ONE_READ() Pop-up window with 1-4 Say/Get combinations

  Returns:
  --------
  Nothing

  Syntax:
  -------
  ONE_READ(cSay,cGetName,cPicture,...)

  Description:
  ------------
  For 1-4 iterations of <cSay..cPicture>, a popup
  window will display a Say <cSay>, do a Get on the variable named in
  <cGetNAme> with a Picture of <cPicture>. A read will then be
  issued.

  This is here for compatibility. POPREAD() provides a
  cleaner solution.

  NOTE: the variables named in <cGetName> CANNOT be
  local or static.

  Examples:
  ---------
   dDate := date()
   cTime := space(8)
   lFun  := .t.

   ONE_READ("Current Date","dDATE","@D",;
       "Current Time","cTIME","99:99:99",;
       "Having Fun ?","lFUN","Y")

  Notes:
  -------
  This is here only for compatibility with older
  versions. Next release, it will cease to be.

  See POPREAD() for a better implementation.

  Source:
  -------
  S_ONER.PRG

 

 

SP_OLD

OLD()

  Short:
  ------
  OLD()  On Line Documentation - TOPIC oriented help system

  Returns:
  --------
  NIL

  Syntax:
  -------
  OLD()

  Description:
  ------------
  This is ON LINE DOCUMENTATION , similiar to NG or Windows help.
  There are no parameters, but it has a couple of additional
  exported functions that allow TOPIC selection and DEVELOPMENT

  The documentation is stored in a DBF database, with one
  record per TOPIC. A TOPIC has a TITLE, stored in the TOPIC field,
  a variable length TEXT entry (can be as long as needed) stored in the
  TEXT field, and hotlinks stored in the KEYS field, which link the TOPIC
  to other topics via a (S)ee also button.

  The options available to the user are:

    (C)ontents   -- go to the CONTENTS screen, a sort of index or
                    table of contents to the topics in the database
    (S)ee also   -- select from related topics
    (O)ther      -- not yet used
    (B)ack       -- go to previous screen

  The DBF structure is TOPIC C 35
                       KEYS  M
                       TEXT  M

  Additional Exported Functions:

  OLD_DEV(bDevelopMent)
      Where bDevelopment is a proc called during development
      of the doc system. Always pass {||OLD_MOD()} to enable
      development, and NIL to disable development. When development
      is active, a prompt called (M)odify appears at the bottom
      of the screen, allowing CREATION, EDITING, DELETING and
      LINKING of topics.

      The options avaialable to the developer are:

       Add Topic                 - create a new TOPIC record
       Edit Topic                - edit the current TOPIC record
       Delete Topic              - delete the current TOPIC record
       Modify SEEALSOs           - add/delete See Also references
       Generate CONTENTS record  - generate the CONTENTS record
                                   either by tagging selected TOPICS
                                   or using ALL topics

  OLD_TOPIC(cTopic)
      This sets the current TOPIC for OLD(). For instance, on
      entry into QUERY(), you could call OLD_TOPIC("QUERY BY EXAMPLE").
      Presuming you had a TOPIC defined called "QUERY BY EXAMPLE",
      this is what would come up when OLD() was called or activated
      with a hotkey.

      Call OLD_TOPIC("") to clear the topic. The default topic is
      the CONTENTS page.

  Examples:
  ---------
  For development:
       OLD_DEV({||OLD_MOD()})
       OLD()
  For distribution, simply comment out the OLD_DEV() call.

  For hotkey activation:
      SETKEY(K_WHATEVER,{||OLD()}  )

  When in a particular part of the program:
       OLD_TOPIC("TOPIC NAME...")
  to activate a particulat topic.

  Notes:
  -------
  There's no reason this couldn't be used alongside of the
  traditional Clipper context sensitive 'field level' help.

  Source:
  -------
  S_OLD.PRG

 

 

SP_NOZDIV

NOZDIV()

  Short:
  ------
  NOZDIV() Prevents divide-by-zero

  Returns:
  --------
  <nNumber> => division result

  Syntax:
  -------
  NOZDIV(nNumber)

  Description:
  ------------
  Prevents divide-by-zero by converting a number to 1
  if it is zero, otherwise leaving it as-is.

  Not really needed in 5.01, but here for backward
  compatibility.

  Examples:
  ---------
   x = 5
   y = 0

   z = x/NOZDIV(y)

  Source:
  -------
  S_NOZDIV.PRG

 

 

SP_NKEY

NKEY()

  Short:
  ------
  NKEY() Gets key of an index file

  Returns:
  --------
  <cKey> => index key expression

  Syntax:
  -------
  NKEY(cIndex)

  Description:
  ------------
  Gets key expression of index <cIndex>. <cIndex> is
  the name of the index including extension. The function operates
  differently from .ntx to .ndx.

  Examples:
  ---------
   for i = 1 to nIndexes

       ?"Key for index: "+aInd[i]+" is "+NKEY(aInd[i])

   next

  Warnings:
  ----------
  Uses up a file handle temporarily. Opens up the index
  with low level file functions.

  Notes:
  -------
  NKEY() expects the full path of the index file and if
  no path is passed, will use SET DEFAULT setting

  Source:
  -------
  S_NKEY.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