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 - importing spreadsheet data http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Importing Spreadsheet data
------------------------------------------------------------------------------------------

   ClipWks includes a program called inport.prg. This program serves as
   an example of using ClipWks as well as a useful function to quickly
   bring data into a .dbf file.

   The Limport() function takes four parameters which control the spread-
   sheet data to be imported into the DBF file. These parameters are the
   filename, the DBF name, an optional range of cells, and a default
   field type to be used if ClipWks cannot make a field determination.

   The first parameter is the spreadsheet name. It must exist and be a
   valid spreadsheet, otherwise Limport will return an error code.

   The second parameter is the name of the DBF file to put the data into.
   If the DBF file exists, its structure is used and data is appended
   into the file. If you want a new file created, be sure to ZAP the
   file before calling Limport().

   If the file does not exist, then Limport() uses the first row in the
   range of cells to determine the types and sizes of the fields in the
   .DBF file. Be sure to specify a cell range that does not include
   headers, since this would result in all fields being character type,
   which might not be what you want. For example:


        +---------------------------------------------------+
        |         A                 B                C      |
        | 1   Name              Hire date        Salary     |
        | 2   Bill Clinton      22-JAN-93        120,000.00 |
        | 3   Al Gore           22-JAN-93         80,000.00 |
        +---------------------------------------------------+

   Specify range A2..C3, rather than A1..C3. If ClipWks can not find
   a cell within the range, it defaults to numeric. You can also specify
   the type of field to create if ClipWks cannot determine the cell
   type. This is the fourth parameter and is optional.

   The third parameter is the range name to import. This can be a named
   range, such as TAX or SALARY (if these fields exist in the file) or
   cell coordinates separated by two periods (or a colon in Excel). If
   the range is not specified, the entire spreadsheet is imported.
   If the range cannot be found, then Limport() returns a error code.

   Limport() contains a translation function which is used to try and
   convert spreadsheet data into the DBF field. It will handle must
   transformations, such as Str() or logical values.



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