Write

Top  Previous  Next

These methods are for writing results from various calculations directly to a DBF or DAT file. DAT is part of a MapInfo TAB file and similar to a DBF file.

 

All 4 variations below allow you to write to gfDecimal, gfFloat, gfInteger, gfSmallInt and gfLogical fields.

In any case values are written so they best possibly are stored in the underlying field.

 

Values which are too big, makes it raise an error, such as storing 100000 in a SmallInt field (valid range -32767 to 32767).

If you try to store a number in a Logical field, all values >0 are treated as True.

 

Length of TIntegerArray, TCostArray and TBitArray need to match the number of records in the file.

 

TIntegerList is treated as a list of records marked as True. If you have reset=true at the same time, all other records are marked as false.

 

Fieldindex is 0-based. If you specify fieldname, it is used instead of fieldindex.

 

Syntax:

Write1(filename: string; fieldindex: integer; fieldname: string; value: TIntegerArray);

Write2(filename: string; fieldindex: integer; fieldname: string; value: TCostArray);

Write3(filename: string; fieldindex: integer; fieldname: string; value: TBitArray);

Write4(filename: string; fieldindex: integer; fieldname: string; value: TIntegerList; reset: boolean);