Adding objects |
Top Previous Next |
There are 5 ways to add objects:
•AddObject followed by AddSection / AddSection2
In all methods the attributes for the object is added as a comma-delimited string.
Always use , as delimiter. Always use . as decimal point. Char fields with " inside, needs to have it escaped with "".
Number of elements in the string must match the number of fields, except for CSV and MIF where the content is written directly to the file.
When using gfChar fields, use Unicode and " around the text. When using gfDate fields, use this format: YYYYMMDD When using gfLogical fields, use this format for true: "T", "t", "Y", "y" or 1. When using gfTime fields, use this format: HHMMSSsss (where sss = millisec, required !) When using gfDateTime fields, use this format: YYYYMMDDHHMMSSsss (where sss = millisec, required !)
For SHP/DBF files, gfTime and gfDateTime are stored as text. For TAB files, use of gfTime or gfDateTime means a version 9.00 file is generated.
Example: A dataset consists of 9 fields, one of each type: gfChar, gfInteger, gfSmallInt, gfDecimal, gfFloat, gfDate, gfLogical, gfTime, gfDateTime
Attribute string: "test_text",1234567,123,123.45,123.45,19991231,1,123456000,19991231123456000
19991231123456000 = 31st of Dec 1999, 12:34:56.000
|