| PutVariant |
|
|
|
|
long PutVariant( VARIANT *VariantBuffer, // variant that contains data long NumberOfElements = -1, // number of elements to write long FilePosition = -1 // position of data in file );
PutVariant( VariantBuffer As Variant, // variant that contains data NumberOfElements As Long = -1, // number of elements to write FilePosition As Long = -1 // position of data in file ) As Long
VariantBuffer can be either single variable or one-dimensional array depending on how many elements are to be written. If only one element is written, VariantBuffer can be a single variable of given type. If more than one element is to be written, VariantBuffer must be a one-dimensional array of one of the allowed types.
VariantBuffer variant can be of one of allowed types: Byte, Integer, Long, Single, Double, String, Boolean, Date, Currency, Decimal and Variant. The array of variants is especially interesting because it allows writing complex structured data with fields of various types. The only limitation is that all arrays must be one-dimensional. As mentioned above VariantBuffer can contain String data; it should be noted, however, that text in variant is always represented by IXFile as length-prefixed Unicode.
NumberOfElements parameter always specifies total number of elements in data sequence regardless of its structure. It means that if VariantBuffer consists of nested subarrays, NumberOfElements specifies number of elements counted recursively through all subarrays - not elements in most outer array.