Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CLIPWKS -Spreadsheet Library - <b>lformat()</b> <b>miscwks.prg</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
lformat()                                                          MISCWKS.PRG
------------------------------------------------------------------------------------------
 Purpose
   Set the format for a range of cells

 Syntax
   Lformat( aSpreadsheet, cRange,cFormat )

 Parameters
   aSpreadsheet - Spreadsheet array handle
   cRange       - Range of cells
   cFormat      - Format to write in cell
                  Dx  = Date           1- DD-MMM-YY
                                       2- MMM-YY
                                       3- DD-MMM
                  Fd  = Fixed          [d]ecimals
                  Pd  = Percent        [d]ecimals
                  ,d  = Comma          [d]ecimals
                  Cd  = Currency       [d]ecimals
                  Sd  = Sci Notation   [d]ecimals

 Returns
   nStatus   -   0  All ok
                -5  Invalid range
                -6  Invalid parameters

 Notes
   The Lformat() function is only needed with Lotus 3.x files.
   Lotus 3.x stores the format information in the header rather
   than the individual cells.  If you need special formats in
   Lotus 3.x from CLIPWKS, you must use the Lformat() function
   first.

 Example
function CreatePayWk
    LOCAL aWks  := Lcreate("PAYROLL","L3")
    LOCAL lFlag := .F.
    if !empty(aWks)
       Lformat(aWks,"B1..B50","F2")   // Fixed, 2 decimals
       Lformat(aWks,"C1..C50",",1")   // Commas with 1 decimal
       Lclose(aWks)
       lFlag := .T.
    endif
return lFlag

 Category
   Creating spreadsheet files

See Also: Lalign()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson