SP_QUIKREPORT

QUIKREPORT()

  Short:
  ------
  QUIKREPORT() Runtime pre-defined report printing module

  Returns:
  --------
  Nothing

  Syntax:
  -------
  QUIKREPORT([cReportName])

  Description:
  ------------
  Presents a picklist of pre-defined reports and prints
  the selected one.

  [cReportName] name of the report to run - picklist is
  bypassed. For batches.

  Examples:
  ---------
   QUIKREPORT('Quarterly Hog Count')

  Warnings:
  ----------
  Requires DBF and indexes to be open

  Source:
  -------
  R_QUIKR.PRG

 

 

SP_QUERY

QUERY()

  Short:
  ------
  QUERY() Popup Interactive query by example condition
  builder

  Returns:
  --------
  <cQuery> => macro expandable logical condition
  expression

  Syntax:
  -------
  QUERY([aFields,aDesc,aTypes],[cQuitTo],[lUseBuildex])

  Description:
  ------------
  A point and shoot condition builder. Complex
  conditions are allowed with multiple .and./.or. Called without
  parameters, all fields in the current dbf are presented for condition
  building.

  [aFields,aDesc,aTypes] give field array, field
  description and field types.These, if passed will be used in
  place of the default of all dbf fields. (pass all or none)

  [cQuitTo] is a 'quit to' phrase. Default exit option
  is 'Quit'. 'Quit to' phrase will be tacked to the end of this .
  i.e. "Quit"+quit_to  [ Quit to Report Writer ]

  [lUseBuildex] determines whether BUILDEX() expression
  builder will be available from QUERY(). Default is not.

  Examples:
  ---------
   USE CUSTOMER

   aFields := {"fname", "lname",  "mi" }
   aFdesc  := {"First", "Last",  "Middle" }
   aTypes  := {"C","C","C"}
   cFilt   := QUERY(aFields,aFdesc,aTypes,nil,.t.)

   count for &cFilt  to nCount

   // or (preferably)
   count for eval( sls_bquery() ) to nCount

  Notes:
  -------
  Query always stores the current query with the
  function SLS_QUERY(). Calling SLS_QUERY() will return the
  currently stored query string. SLS_BQUERY() returns the query as
  a codeblock. Remember to clear sls_query()/sls_bquery() when
  changing DBFs.

  Source:
  -------
  S_QUERY.PRG

See also : SLS_BQUERY(), SLS_QUERY()

 

 

SP_QFLDSTYPE

QFLDSTYPE()

  Short:
  ------
  QFLDSTYPE() Count # of fields of a given type or types

  Returns:
  --------
  <nCount> => number of fields of the specified type(s)

  Syntax:
  -------
  QFLDSTYPE(cTypes)

  Description:
  ------------
  <cTypes> is a string containing one or more field
  type symbols

  Valid symbols are:

           C   character
           N   numeric
           L   logical
           D   date
           M   memo

  If no fields of the specified type(s) exist, 0 will
  be returned

  Examples:
  ---------
   nMemos := QFIELDSTYPE("M")   // number of memo fields
   nNums  := QFIELDSTYPE("N")   // number of numeric fields
   nNums  := QFIELDSTYPE("LD")  // number of date and logical fields

  Source:
  -------
  S_AFTYPE.PRG

See also : AFIELDSTYPE()

SP_P_READY

P_READY()

  Short:
  ------
  P_READY() Determines if printer is ready, prompts user

  Returns:
  --------
  <lReady> => True if printer is ready

  Syntax:
  -------
  P_READY([cPort])

  Description:
  ------------
  Checks for printer ready, and prompts user to ready
  the printer until it is ready, or until user presses escape to
  abort printing.

  P_READY() first looks at SLS_PRNC(), and if the
  value is .f., does no printer check and returns .t.

  [cPort] - LPT1 LPT2 LPT3
  Default is LPT1

  Examples:
  ---------
   if P_READY("LPT2")
     REPORT FORM yayaya TO PRINT
   ENDIF

  Notes:
  -------
  To stop P_READY() from checking the printer port (as
  it is imbedded in many SuperLib functions), call SLS_PRNC() with
  False. This turns printer checking off. (i.e. on a network)

  Source:
  -------
  S_PREAD.PRG

See also : P_RDYDELAY(), P_READY(), SLS_PRNC()

 

 

SP_P_RDYDELAY

P_RDYDELAY()

  Short:
  ------
  P_RDYDELAY() Sets/returns p_ready() 'seconds' variable

  Returns:
  --------
  <nSeconds> => p_ready() seconds variable

  Syntax:
  -------
  P_RDYDELAY([nSeconds])

  Description:
  ------------
  P_READY() tries for 5 seconds by default to check the printer
  for readiness. This function retrieves/sets the variable that
  controls the # of seconds to try for.

  Examples:
  ---------
  P_RDYDELAY(10)

  Source:
  -------
  S_PREAD.PRG

SP_PURGEM

PURGEM()

  Short:
  ------
  PURGEM() Deletes records

  Returns:
  --------
  Nothing

  Syntax:
  -------
  PURGEM()

  Description:
  ------------
  Deletes records of the currently opened DBF.

  Examples:
  ---------
   if lClean_em_up
       select 0
       use QUERIES
       PURGEM()
   endif

  Notes:
  -------
  This is intended for those small system files created
  by QUERY(), FORMLETR(), LISTER() etc.

  No PACKING is done.

  Source:
  -------
  S_PURGEM.PRG

 

SP_PULLDN

PULLDN()

  Short:
  ------
  PULLDN() Pulldown menu creator, handler

  Returns:
  --------
  <nSelection> => Selection in the form menu.prompt
  (i.e. 2.04)

  Syntax:
  -------
  PULLDN(nSelection,aOptions,[aAttributes],[aColumns])

  Description:
  ------------
  Draws a pulldown menu with up to 8 separate boxes.
  Selection process starts with <nSelection>.

  Each element of <aOptions> defines a menu.

  A menu definition is a delimited string in the form:

        "TITLE:prompt:prompt:prompt"

  with up to 99 prompts per string.

  When a selection is made, the number of the selection
  is returned, in the form BOX.OPTION . So option 2 in box 3 would
  come back as 3.02.

  [aAttributes] is a box definition array. It is 7
  elements long and defines the following:

  Element:          1. <lDraw>      Draw top bar box? T/F
                    2. <cBarColor>  Top bar color
                    3. <cBoxColor>  Menu Box color
                    4. <cBoxFrame>  Menu Box frame
                    5. <nShadowPos> Menu Box shadow position
                               (0,1,3,7,9)
                    6. <nShadowAtt> Menu Box shadow attribute
                    7. <nBarRow>    Row to start menu bar

  [aColumns] is an array of title column positions to
  override the internal 'figerin algorithm.

  Examples:
  ---------
   aOptions := { "Datafiles:Use Datafile",;
                 "Indices:Select Indices:Index order",;
                 "Editing:Replacement:Tabular Edit",;
                 "Reporting:Build Query:Print Lists",;
                 "Other:List file:Change Directory",;
                 "Quit" }

   aAttrib := { .t.,;               // draw the top bar box
                'W/B,GR/R,,,W/N',;  // top bar color
                'W/B,N/R,,,W/N',;   // drop box color
                cSingle_frame,;     // drop box frame
                3,;                 // drop box shadow position
                8,;                 // drop box shadow  attribute
                0 }                 // row # of menu bar

   nSel  := 1.01
   do while .t.
       nSel := PULLDN(nSel,aOptions,aAttrib)
       do case
       CASE nSel = 0  && TRAP 0
           nSel = 1.01
       case nSel = 1
       case nSel = 2
       case nSel = 3
       case nSel = 4
       endcase
   enddo

  Warnings:
  ----------
  It takes some work to start all options and titles
  with a first letter that is unique so that first letter selection may
  take place.

  Notes:
  -------
  First letter selection takes place on the following
  priority: next matching element first letter, next matching box
  title first letter.

  Passing a menu array element with title only will
  result in no menu box, with the title being the only selection
  and returning a selection value of <MENU>.1.
  (i.e. a 'Quit' box)

  Source:
  -------
  S_PULLDN.PRG

 

 

SP_PSTABMENU

PSTABMENU()

  Short:
  ------
  PSTABMENU() Popup tabular (grid style) )menu

  Returns:
  --------
  <nSelection> => Number of menu option selected

  Syntax:
  -------
  PSTABMENU(nTop,nLeft,nBottom,nRight,aPrompts,[cTitle],[nStart])

  Description:
  ------------
  Pops up a tabular (grid) menu based on an array of
  prompts passed

  as <aPrompts>. Dimensions of the menu table will be
  inside of the <nTop,nLeft,nBottom,nRight> dimensions for the popup
  box. Number of menu rows is the number of rows inside the box.
  Number of menu columns is determined based on number of rows.
  Prompts are layed out in a snaking fashion :

     e.g. (for a 3 row table...)
       column 1, row 1  = 1st prompt
       column 1, row 2  = 2nd prompt
       column 1, row 3  = 3rd prompt
       column 2, row 1  = 4th prompt

  Pressing a character will move to the next matching
  prompt with that first letter. Left-right and up-down perform a
  snaking pattern

  Pressing ENTER causes selection to be made, and the
  number of the selection to be returned.

  Pressing ESCAPE returns 0.

  [cTitle]  is a itle for the popup box

  [nStart]  is an optional starting option. Default is 1.

  Examples:
  ---------
   nChoice := pstabmenu(10,10,14,70,{"One","two","three","four",;
                        "five","six","seven","eight",;
                         "nine","ten","eleven","twelve"},"Select:")

  Source:
  -------
  S_TABMEN.PRG

 

SP_PROPER

PROPER()

  Short:
  ------
  PROPER() Capitalizes first letters of string, lowers rest

  Returns:
  --------
  <cProper> => string properized

  Syntax:
  -------
  PROPER(cTarget)

  Description:
  ------------
  Capitalizes all first letters of words in <cTarget>
  and converts the rest to lowercase

  Examples:
  ---------
   cString := "SUPER liBraRy"

   cString := PROPER(string)

   // (returns "Super Library"

  Notes:
  -------
  There are cases where this just won't work - for
  instance I.B.M. would be converted to I.b.m.

  Source:
  -------
  S_PROPER.PRG