Danny A. del Pilar

Contributed works of Danny A. del Pilar

Browse Test Demo

Easter Sunday Calculation

Generate Gregorian Calendar

HMG source code converter

How to build menu like old ACHOICE function?

KPI (Key Performance Indicator) Dashboard

Return value from modal window (Record Picker) 

Similar SCATTER / GATHER en HMG

SP_S1LABEL

S1LABEL()

  Short:
  ------
  S1LABEL() Prints a single label

  Returns:
  --------
  Nothing

  Syntax:
  -------
  S1LABEL(cLblfile)

  Description:
  ------------
  Prints a single label (1 or more copies) for the
  current record, based on the dimensions and contents definitions in
  .LBL file name <cLblfile>. The dimensions and contents are
  figured, and then presented for printing and/or editing.

  Examples:
  ---------
   setkey(K_F10,{||S1LABEL("MAILING.LBL")} )
                      // sets key F10 to call this
                     // as a popup

  Source:
  -------
  S_1LABEL.PRG

 

SP_ISBLANKREC

ISBLANKREC()

  Short:
  ------
  ISBLANKREC() Determines if a record is blank

  Returns:
  --------
  <lIsblank> => is the record blank

  Syntax:
  -------
  ISBLANKREC()

  Description:
  ------------
  Returns True if the record is all blanks

  Examples:
  ---------
   LOCATE for ISBLANKREC()

   if found()
     // re-use
   else
     APPEND BLANK
   endif

  Source:
  -------
  S_BLANK.PRG

 

SP_FASTFORM

FASTFORM()

  Short:
  ------
  FASTFORM() Prints a selected formletter for current record

  Returns:
  --------
  Nothing

  Syntax:
  -------
  FASTFORM()

  Description:
  ------------
  Presents a picklist of formletters to print against
  contents of current record.

  Examples:
  ---------
   If nChoice = 4    // form letter
     FASTFORM()
   endif

  Notes:
  -------
  Utilizes a form created by FORMLETR() and plugs in
  values from the current record. Interface is a picklist of forms
  available. Depends on the current DBF to match the field values
  in the form.

  Source:
  -------
  S_FFORM.PRG


SP_DUPHANDLE

DUPHANDLE()

  Short:
  ------
  DUPHANDLE() Duplicate record finder with delete/copy options

  Returns:
  --------
  Nil

  Syntax:
  -------
  DUPHANDLE([aFields,aDesc],[aOpenIndexes])

  Description:
  ------------
  DUPHANDLE() is similiar to DUPLOOK(), but takes a
  different approach The user is asked to select fields (only
  Character fields are presented) to check for duplication. The
  fields selected are combined into an index key, and an index is
  created. The database is then scanned for duplicates. If a
  duplicate set is found, a Tbrowse/tag window is popped up, and
  the user is asked to tag records. This continues until all
  duplicate sets are found, or the user chooses to quit the
  process. The user is then allowed to Process the tagged
  duplicate records. There are 4 possible options:

         Delete all tagged records
         Delete all NOT tagged records
         Copy all tagged records
         Copy all NOT tagged records

  The options are not mutually exclusive. For instance,
  you could copy all tagged records to a history file, and then
  delete them.

  As with all SuperLib deletions, the PACKING is left
  to you.

  [aFields,aDesc] are optional arrays of fieldnames and
  field descriptions

  [aOpenIndexes] is an optional array of currently open
  index names. Clipper has no way to determine the names of
  currently open indexes and, since this function creates
  temporary indexes, the current indexes will be closed. Only by
  having a list [aOpenIndexes] can we re-open the indexes on exit.

  Examples:
  ---------

  USE customer

  duphandle()

  Warnings:
  ----------
  Closes all indexes.

  Source:
  -------
  S_DUPH.PRG

 

SP_DELREC

DELREC()

  Short:
  ------
  DELREC() Dialog box to delete/undelete current record

  Returns:
  --------
  <nStatus> => If deleted 1, if undeleted-1, if no
  action 0

  Syntax:
  -------
  DELREC()

  Description:
  ------------
  Asks for delete/undelete record with menu prompt and
  then deletes/undeletes or not If current record is not deleted,
  prompt will be

       DELETE  NOACTION

  If current record is deleted, prompt will be

       UNDELETE  NOACTION

  Examples:
  ---------
   IF nChoice = 6
       nDelstat := DELREC()
   ENDIF

  Source:
  -------
  S_DELET.PRG

 

SP_DBF2ARRAY

DBF2ARRAY()

  Short:
  ------
  DBF2ARRAY() Returns an array of values for the current record

  Returns:
  --------
  <aValues> => an array of values in the current record

  Syntax:
  -------
  DBF2ARRAY()

  Description:
  ------------
  Returns an array of values for the current record,
  with the order of the array the same as the ordinal field
  order.

  Examples:
  ---------
   use customer

   a := DBF2ARRAY()            // store values
   for i = 1 to len(a)
     @0+i,0 get a[i]
   next

   read                        // edit them
   if AUPDATED(a)              // if they were updated from  the DBF values
     ARRAY2DBF(a)              // save them
   endif

  Source:
  -------
  S_DBARR.PRG

 

SP_BLANKREC

BLANKREC()

  Short:
  ------
  BLANKREC() Blanks out a record

  Returns:
  --------
  <lSuccess> => success, or not

  Syntax:
  -------
  BLANKREC([nTries,lInteractive,cMessage])

  Description:
  ------------
  Attempts to lock the record <nTries> (default 5), and
  if no luck and <lInteractive> (default False), prompts
  the user with <cMessage> (default "Unable to lock record. Keep
  trying?")

  If a lock is gotten, the record is replaced with
  blank values.

  See BLANKFIELD()

  Examples:
  ---------
   DELETE
   BLANKREC()

  Notes:
  -------
  Use ISBLANKREC() to locate blank records. This is a
  good way to re-use records, rather than using PACK.

  Source:
  -------
  S_BLANK.PRG

 

SP_AUPDATED

AUPDATED()

  Short:
  ------
  AUPDATED() Determines if array contains updated values for record

  Returns:
  --------
  <lUpdated> => Are the values in the array updated

  Syntax:
  -------
  AUPDATED(aCheck)

  Description:
  ------------
  Compares the values in an array (usually created with
  a call to DBF2ARRAY() )  <aCheck> with the current values in the
  current record. The order of the array is presumed to match the
  order of the fields, and to be of length fcount(). If the values
  in the array are updated (changed), True is returned.

  Examples:
  ---------
   use customer
   a := DBF2ARRAY()            // store values
   for i = 1 to len(a)
     @0+i,0 get a[i]
   next
   read                               // edit them
   if AUPDATED(a)              // if they were updated from  the DBF values
     ARRAY2DBF(a)              // save them
   endif

  Source:
  -------
  S_DBARR.PRG

 

SP_ARRAY2DBF

ARRAY2DBF()

  Short:
  ------
  ARRAY2DBF() Replaces current record with values in an array

  Returns:
  --------
  Nil

  Syntax:
  -------
  ARRAY2DBF(aValues)

  Description:
  ------------
  Replaces the values in the current record with the
  values in <aValues>. Array order is assumed to be the same as
  the ordinal field order.

  Examples:
  ---------
   use customer
   a := DBF2ARRAY()            // store values

   for i = 1 to len(a)
     @0+i,0 get a[i]
   next
   read                        // edit them

   if AUPDATED(a)              // if they were updated from
                               // the DBF values
     ARRAY2DBF(a)              // save them
   endif

  Source:
  -------
  S_DBARR.PRG