SP_BUNGDROP

BUNGDROP()

  Short:
  ------
  BUNGDROP() Causes dropdown during BUNGEE() menu def sequence

  Returns:
  --------
  NIL

  Syntax:
  -------
  BUNGDROP([nDown],[nOver])

  Description:
  ------------
  BUNGDROP() causes a dropdown to occur during a BUNGEE() menu
  definition sequence. This is followed by a series of BUNGOPTION()
  and then BUNGUNDROP() to end the dropdown.

  [nDown] Number of rows down from row of current option (default 1)
  [nOver] Number of columns over from column of current option
          (default is 0 for bar options, 1 for dropdown options)

  Use BUNGSTART(), BUNGEND(), BUNGOPTION(),
  BUNGDROP(), BUNGUNDROP() together to create a menu definition
  array for BUNGEE(). While it is not necessary to use these
  functions to create the array, it is helpful when you have
  a complex, multi-level dropdown structure.

  See BUNGEE for more information.

  Examples:
  ---------

  bungstart()

     bungoption("Files")
     bungdrop()
          bungoption("Open" ,{} ,{||!lFileIsOpen} )
          bungoption("Close",{||nil},{||lFileIsOpen } )
     bungundrop()
     bungoption("Edit")
     bungdrop()
          bungoption("DBF"  ,{||nil},nil )
          bungoption("Ascii",{||nil},nil )
     bungundrop()
     bungoption("Quit",{||bungeequit()},nil)

  aMenu := bungend()
  bungee(0,0,79,aMenu)

  Source:
  -------
  S_BUNGDEF.PRG

 

SP_BUILDEX

BUILDEX()

  Short:
  ------
  BUILDEX() Interactively builds and returns an expression string

  Returns:
  --------
  <cExpression> => An expandable expression string

  Syntax:
  -------
  BUILDEX(cDescript,cStart,lTypeChange,[aFields,aDesc])

  Description:
  ------------
  Interactively builds and returns an expression string.

  Pass parameters of <cDescript> - a descriptive name
  for the expression, <cStart> an existing expression
  (field,etc.),

  <lTypeChange> allow TYPE change by BUILDEX()

  Pass all or none of the following arrays

  [aFields]   An array of field names

  [aDesc]     An array of field descriptions

  Examples:
  ---------
   cExpress :=buildex("Index Expression",COMPANY,.F.)

  Notes:
  ------
  Release 3.5 adds the ability to directly edit the expression.

  Source:
  -------
  S_BUILD.PRG

 

SP_BROWSESDF

BROWSESDF()

  Short:
  ------
  BROWSESDF() Tbrowse an SDF file

  Returns:
  --------
  Nothing

  Syntax:
  -------
  BROWSESDF(cFile,aDesc,aTypes,aLengths)

  Description:
  ------------
  Tbrowses an SDF file <cFile>, using column headers in
  <aDesc>, with field 'types' in <aTypes>, and field lengths in
  <aLengths>

  Examples:
  ---------

   //sample.sdf looks like this:

   //AHLBERG              STEPHEN           23.4519890226
   //SMITH                JEFF              45.0019890301
   //SMITH                DENNIS             0.0019890313
   //ALVARADO             DAVID             25.0019890330

   //note: widths have to be exact

   browseSDF("sample.sdf",{"Last","First","Due","Date"},;
                          {"C","C","N","D"},;
                          {20,15,8,8})

  Source:
  -------
  S_BRSDF.PRG

 

SP_BROWSEDELIM

BROWSEDELIM()

  Short:
  ------
  BROWSEDELIM() Tbrowse a delimited file

  Returns:
  --------
  Nothing

  Syntax:
  -------
  BROWSEDELIM(cFile,aDesc,aTypes,aLens,[cFieldDelim],;
            [cCharDelim])

  Description:
  ------------
  Browse delimited file <cFile>.

  Column titles are contained in <aDesc> (one for each 'field').

  Field types are contained in <aTypes>, Field lengths
  are contained in <aLens>.

  [cFieldDelim] - Field delimiter - default is a comma [,]

  [cCharDelim] - Character type delimiter - default is
  a double quote [""]

  Examples:
  ---------

   //sample.asc looks like  this:

   //"AHLBERG","STEPHEN",23.45,19890226
   //"SMITH","JEFF",45.00,19890301
   //"SMITH","DENNIS",0.00,19890313
   //"ALVARADO","DAVID",25.00,19890330
   //"AMPOLSUK","EARL",60.00,19890406
   //"ANDRADE","GARRY",55.00,19890301
   //"ANDRADE","WALT",99.99,19890703

   browsedelim("sample.asc",{"First","Last","Due","Date"},;
                          {"C","C","N","D"},;
                          {15,25,6,8})

  Source:
  -------
  S_BDELIM.PRG

 

SP_BROWSE2D

BROWSE2D()

  Short:
  ------
  BROWSE2D() Popup  tbrowse of 2 dimension array (array of arrays)

  Returns:
  --------
  <nSelection> => selected item, 0 if none

  Syntax:
  -------
  BROWSE2D(nTop,nLeft,nBottom,nRight,aArr,[aHead],[cColor],;
        [cTitle],[bExcept])

  Description:
  ------------
  Pops up a box at <nTop,nLeft,nBottom,nRight> and
  tbrowses array contained in <aArr>.

  <aArr> must be a 2 dimensioned array, like the ones
  returned from DIRECTORY() or DBSTRUCT().

  i.e. { array(n),array(n),array(n) } where <n> is the
  same length for each subarray.

  [aHead] an array of column headers matching the
  number of elements in a single subarray of <aArr>. Default is
  none.

  [cColor] popup box color. Default is sls_popcol()

  [cTitle] title string for the box. Default is none.

  [bExcept] is a codeblock that will be evaluated for
  any exception keys - any keys other than up/ down/ right/ left/
  pgup/ pgdn/ home/ end/ enter/ esc. [bExcept] will be passed the
  parameters: key value, tbrowse object, element

  Examples:
  ---------

   proc test

   local a := directory()
   browse2d(5,5,20,40,a, ;
           {"File","Size","Date","Time","Attribute"},,"Choose a File")

   use customer
   a := dbstruct()
   browse2d(5,5,20,40,a,nil,nil,nil,;
    {|k|msg(str(k)+" is not a valid key")})
   // note the exception block

  Source:
  -------
  S_2DBRZ.PRG

 

SP_BOYEAR

BOYEAR()

  Short:
  ------
  BOYEAR() Determine beginning of year a date falls in

  Returns:
  --------
  <dReturn> => Date of the beginning of the year

  Syntax:
  -------
  BOYEAR([dTarget])

  Description:
  ------------
  Determines beginning of the year of a date and
  returns it as <dReturn>. [dTarget] a date variable. Default is
  DATE()

  Examples:
  ---------
   dBegyear := BOYEAR(date())

  Source:
  -------
  S_BOYEAR.PRG

 

SP_BOM

BOM()

  Short:
  ------
  BOM() Calculates beginning of the month date

  Returns:
  --------
  <dReturn> => Date which is beginning of the month

  Syntax:
  -------
  BOM(dTarget)

  Description:
  ------------
  Calculates date which is beginning of the month from
  <dTarget>

  Examples:
  ---------
   dDate := ctod("10/15/90")

   dBom  := BOM(DDate)    //    => 10/01/90

  Source:
  -------
  S_BOM.PRG

 

SP_BLDNDX

BLDNDX()

  Short:
  ------
  BLDNDX() Interactively create a new index

  Returns:
  --------
  <cIndexName> => New index name less extension

  Syntax:
  -------
  BLDNDX([aFields,aDescriptions],[aIndexfiles],[Buildex])

  Description:
  ------------
  Allows point and shoot building of a new index.

  [aFields] - an array of legal field names. If not
  passed, all fields  in current DBF will be used.

  [aDescriptions] - an array of field descriptions. If
  not passed,field names  in current DBF will be used.

  Pass both or neither of  [aFields] and
  [aDescriptions].

  [aIndexFiles]   - an array of currently open index
  files to be reopened on exit from bldndx() (up to 10).
  Otherwise, only the newly created index file will be left open.

  [lBuildex]  - allow use of Buildex() to build complex
  expressions. Default is False.

  Examples:
  ---------
   BLDNDX()

    -- or --

   aNdxFlds  := {"LASTNAME","FIRSTNAME","CITY"}
   aNdxDesc  := {"Last Name","First Name","City"}
   aNdxOpen  := {"CUSTOMER","STATE","ZIPCODE"}
   BLDNDX(aNdxFlds,aNdxDesc,aNdxOpen)
   BLDNDX(nil,nil,aNdxOpen,.t.)   // use buildex()

  Warnings:
  ----------
  Indexes created with this function will require the
  functions DTOS() and NBR2STR() be loaded prior to use if a date
  or numeric field is part of the index. You can do this with the
  EXTERNAL statement.

  EXTERNAL DTOS, NBR2STR

  Notes:
  -------
  All fields are converted to type Character. The
  function NBR2STR() is used to create a usable character
  expression from a numeric field by first adding 1,000,000 to the
  number.

  Source:
  -------
  S_BLDNDX.PRG

 

SP_BLDDBF

BLDDBF()

  Short:
  ------
  BLDDBF() Create a DBF from a delimited string or an array

  Returns:
  --------
  <lSuccess> => Success or failure

  Syntax:
  -------
  BLDDBF(cDbfName,acDefinition)

  Description:
  ------------
  Creates DBF file named <cDbfName> from delimited
  strings in <acDefinition>.

  <acDefinition>  is either:

  1.  a Delimited string in the form
      "name,type,[size],[decimals]:name,type..."
      Fields delimited by colon, field elements delimited by commas

  2.  an array of delimited strings in
      the form "name,type,[size],[decimals]". One field
      per array element, field elements delimited by
      commas.

  Examples:
  ---------
   1. Passing long delimited string

       BLDDBF('CUSTOMER','LNAME,C,15:FNAME,;
         C,10:AGE,N,2:PROSPECT,L:')

   2. Passing array of short delimited strings

       aNewdbf       := array(4)
       aNewdbf[1]    :="LNAME,C,15"
       aNwdbf[2]     :="FNAME,C,10"
       aNewdbf[3]    :="AGE,N,2"
       aNewdbf[4]    :="PROSPECT,L"
       lSuccess      := BLDDBF('CUSTOMER',aNewdbf)

  Notes:
  -------
  BLDDBF() expects an unused area to work in, and will
  return .f. if it detects a DBF open in the current area. An
  overwrite will not be allowed. BLDDBF() uses Clipper's low level
  file functions to create the DBF file. You could also (and
  should) use Clipper 5.01's DBCREATE() function. This function is
  here mainly for compatibility with previous SuperLibs.

  Source:
  -------
  S_BLDBF.PRG

SP_BLDARR

BLDARR()

  Short:
  ------
  BLDARR() Builds an array from a delimited string

  Returns:
  --------
  Nothing

  Syntax:
  -------
  BLDARR(aTarget,nCount,cDelimited)

  Description:
  ------------
  Fills in the elements of an existing array <aTarget>
  with <nCount> character values extracted from a delimited string
  <cDelimited> of the form "Garry:Wyn:Ralph:Ed". The colon [:] is
  the delimiter. The first parameter is an array of any length. It
  will be sized to fit.

  Examples:
  ---------
   aLunch := array(3)
   BLDARR(aLunch,3,"Pizza:Chicken:Burgers")
       // =>  {"Pizza","Chicken","Burgers"}

  Notes:
  -------
  Array must be declared prior to calling.
  Of course, in Clipper 5.01 you can also use:
  myarray := {"Pizza","Chicken","Burgers"},
  and this function is mainly here for compatibility.

  Source:
  -------
  S_BLDAR.PRG