SP_GENVAL

GENVAL()

  Short:
  ------
  GENVAL() Generic VALID clause validation with message

  Returns:
  --------
  <lValid> => logical result of passed condition

  Syntax:
  -------
  GENVAL(expValid,expMessage)

  Description:
  ------------
  Evaluates <expValid>, which is either a bode block or
  a string to be macro expanded, as a logical value. If result is
  False, displays message <expMessage> and waits for a keypress.
  <expMessage> can be a single string, or an array of strings (see
  aMsg() ).

  Examples:
  ---------
   if genval("fcount() < 60",'Too many fields')
       COPY TO TEMP
   endif

   * ...or as a VALID CLAUSE macro'd

   @10,10 get lname VALID ;
     GENVAL("!empty(lname)","Need a last name")

   * ...or as a VALID CLAUSE eval'd

   @10,10 get fname VALID ;
     GENVAL( { || !empty(fname) },"Need a last name")

  Source:
  -------
  S_GENVA.PRG

 

SP_GENREADER

GENREADER()

  Short:
  ------
  GENREADER() Creates specialized user defined get reader block

  Returns:
  --------
  <bReader> => get reader block for GET

  Syntax:
  -------
  GENREADER(bBlock,lPass)

  Description:
  ------------
  Creates a get reader block that first passes control
  to code block <bBlock> for each keypress. <bBlock> is passed
  the following values:

       1. lastkey() value
       2. proc name
       3. var name
       4. current get value

  If <bBlock> returns any value but a Nil, the get is
  assigned this value. If a Nil is returned, and <lPass> is True,
  then the key is passed to the regular get handler.

  Implement by using the SEND keyword for your
  @Say..Get.. statements.

    @10,10 say blah get blahblah SEND reader:=GENREADER(bBlock,lPass)

  Or simply refer to the last get added with ATAIL(getlist)

    @10,10 say blah get blahlblah
    ATAIL(getlist):reader := GENREADER(bBlock,lPass)

  Examples:
  ---------
   // while in the get V1, you will be able to type 1, 2 or 3
   // to get a value from the array

   aValues := {"Section 1","Section 2","Section 3"}
   bBlock  := ;
        {  | k|  iif( (nAtk:=at(chr(k),"123")) >  0,aValues[nAtk],nil)  }

   v1 := "Section 1"
   @10,10 get v1 send reader := genreader(bBlock)
   READ

  Source:
  -------
  S_READRS.PRG

 

SP_GENED

GENED()

  Short:
  ------
  GENED() Generic dbf editing screen

  Returns:
  --------
  Nothing

  Syntax:
  -------
  GENED([lModify],[nTop,nBottom],[aFields,aDesc])

  Description:
  ------------
  Edit ( [lModify] =.f.) current record (DEFAULT) or

  Add  ( [lModify] =.t.) new record.

  Window top [nTop] and bottom [nBottom] default to
  centered.

  Use optional [aFields] (field names) and [aDesc]
  (field descriptions), or use all fields in dbf.

  Examples:
  ---------
   use Customer index Customer

   Gened(.f.,2,20)   // edit

  Notes:
  -------
  Allows memo editing (multiple memo fields)
  New to 3.5: memo editing is done to a memvar. Changes aren't
  saved unless the whole record is saved. A global [F3=Memo] key
  lets you pick which memo to edit.

  Source:
  -------
  S_GENED.PRG

 

SP_FULLDIR

FULLDIR()

  Short:
  ------
  FULLDIR() Interactively navigate directories

  Returns:
  --------
  <lSelected> => Directory was selected

  Syntax:
  -------
  FULLDIR([lChange],[@cDirName])

  Description:
  ------------
  Interactively navigates directories on the current
  drive.

  Allows reading of a file ( with FILEREAD() ) in a
  directory.

  If file is DBF, does a DBEDIT browse (watch your
  memory..)

  [lChange]    True - change to selected directory
               False - don't change to selected directory
               Default is True - change

  [@cDirName] Char string passed by reference, will
  contain name of selected directory on return.

  Examples:
  ---------
   cNewDir := ""

   if FULLDIR(.F.,@cNewDir)
       SET DEFAULT TO (cNewDir)
       ?"New directory is:"
       ?Curdir()
   endif

   if FULLDIR(.t.)
       ?"New directory is:"
       ?Curdir()
   endif

  Source:
  -------
  S_FULLD.PRG

 

SP_FREQANAL

FREQANAL()

  Short:
  ------
  FREQANAL() Performs a frequency analysis on a DBF

  Returns:
  --------
  Nothing

  Syntax:
  -------
  FREQANAL()

  Description:
  ------------
  Performs a point&shoot frequency analysis on selected
  fields of the DBF.

  Allows for tallying of additional numeric fields.

  New to 3.5 - now allows fields of type C D and N to be added
  to the frequency string. Additional Summary fields are now named
  SUM_1, SUM_2...etc in the output results. (previously they retained
  their original name)

  Examples:
  ---------
   USE (cDbfName)

   FREQANAL()

  Source:
  -------
  S_FREQ.PRG