home *** CD-ROM | disk | FTP | other *** search
- /*
- this is an example of how to create a .DBF file
- the argument to "createDbf" is an array of arrays
- of field defintions. each field definition array
- contains a string that is the DBASE field name,
- a character field type ('C' = char, 'N' = numeric, 'D' = date),
- an integer length, and an integer number of decimals for numerics
- */
- db = createDbf("test",[
- ["cfield",'C',32,0],
- ["nfield",'N',5,0],
- ["dfield",'D',0,0],
- ["mfield",'M',1024,0]]);
-
- i = 1;
- while(i < 10) {
- nfield = i;
- cfield = "test"+asString(i);
- dfield = date();
- mfield = "memo" + asString(i);
- res = write(db,0L);
- i = i+1;
- }
-
- ? "table TEST.DBF created";
- ? "structure is ",structure(db);
- close(db);
-