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>frmtowks()</b> <b>frm2wks.prg</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
frmtowks()                                                         FRM2WKS.PRG
------------------------------------------------------------------------------------------
 Purpose
   To convert a report form file to a spreadsheet

 Syntax
   Frmtowks( cReport_form, cSpreadsheet, cVersion )

 Parameters
   cReport_form - name of the report form file to use
   cSpreadsheet - name of the spreadsheet to create, the extension is optional
   cVersion     - type of spreadsheet to produce, optional, will default to L2

 Returns
   nStatus  -   -1 Form file is missing
                -2 I/O error reading form file
                -3 Invalid form file
                -4 Error creating spreadsheet
                -5 No current work area

 Notes
   FRMTOWKS() is used to read standard report form files and
   create spreadsheets from their contents.  This allows you to
   give the user the option of printing to the screen/printer/ or
   a spreadsheet.

   The valid spreadsheet types are:

   L1  - Lotus 1.x         QU  - Quattro
   L2  - Lotus 2.x         QP  - Quattro Pro
   L3  - Lotus 3.x         SY  - Symphony
   E2  - Excel 2.x         E3  - Excel 3.x for Windows
   E4  - Excel 4.x

 Category
   High-level functions

 Example

function DoReport( cFile,cOutput )
    LOCAL nResult
    LOCAL nChoice := 0
    LOCAL aErrors := { "No such form file",;
                       "Problem reading form file",;
                       "Invalid report form file",;
                       "Disk error creating spreadsheet",;
                       "No active work area selected";
    }

    @ 10,10 prompt "Print report"
    @ 11,10 prompt "Display to the screen"
    @ 12,10 prompt "Make a spreadsheet"

    menu to nChoice

    do case
        case nChoice == 1
            report form (cFile) to printer
        case nChoice == 2
            report form (cFile) to console
        case nChoice == 3
            nResult := FrmToWks( cFile,cOutput )
            if nResult < 0
                Alert( aErrors[abs(nResult)] )
            endif
    endcase
return nil
.

See Also: Lalign()

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