SP_SGETMANY

SGETMANY()

  Short:
  ------
  SGETMANY()    Virtual (scrolling)  gets in a popup box

  Returns:
  --------
  <lSave> => False if ESC pressed, true otherwise

  Syntax:
  -------
  SGETMANY(aGets,aDesc,nTop,nLeft,nBottom,nRight,[cTitle],[cFoot],[nPadding])

  Description:
  ------------
  READs a series of GETs in a popup box, with the
  ability to scroll the GETs up/down when there are more GETs than fit in
  the box.

  <aGets> is an array of get objects. There are two
  ways to create this:

      1.    Use GETNEW() (the Clipper function) to create each
            individual get object. Get row and column do not
            matter - they will be adjusted.

            GET postblock and preblock (valid and when)
            may be assigned as normal. As each new GET object is created,
            add it to an array.

            Pass this array as <aGets>.

      2.    Use the normal @row,col GET... commands, but to a
            location off the screen - otherwise the gets will DISPLAY
            as you are assigning them.

            @MAXROW()+1,MAXCOL()+1 GET... works for me.

  Using @...GET automatically places new get
  objects in the global array GETLIST. Pass GETLIST as <aGets>.

  <aDesc> this is an array of descriptions for each
  get. (the SAY portion). These will be displayed to the left of
  the get.

  <nTop,nLeft,nBottom,nRight> are the dimensions of the
  popup box. The Editing area will be the inside dimensions of this
  box. Make sure there's room!

  [cTitle] is a string to be used for the title.
  Displayed at <nTop>,<nLeft>+1

  [cFoot] is now ignored. This parameter used to be the footer. It
  is now just a placeholder for downward compatibility.

  [nPadding] is for the number of spaces of padding
  between the box frame and the editing area. The default is 0,
  which places the editing area at
  nTop+1,nLeft+1,nBottom-1,nRight-1. A [nPadding] of 1 would place
  the editing area at nTop+2,nLeft+2,nBottom-2,nRight-2 etc.

  Examples:
  ---------

   local i
   local aDesc := {}
   local aGets
   USE CUSTOMER
   aGets := dbf2array()

   for i = 1 to len(aGets)
     @maxrow()+1,maxcol()+1 get aGets[i]
     aadd(aDesc,field(i))
   next

   SGETMANY(getlist,aDesc,10,10,17,50,;
         "Editing","ESC quits, F10 saves",1)

  NOTES:
  -------
  Do not pass a 0 length string as a GET

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