This method writes data from a variable to a disk file.
file.Put data, [recnumber]
None.
Data written with Put usually is read from a file with Get.
The first record or byte in a file is at position 1, the second record or byte is at position 2, and so on. If you omit recnumber, the next record or byte after the last Get or Put method or pointed to by the last Seek function is written.
For files opened in Random mode, the following rules apply:
You can use the Put method to write a Variant array to disk, but you cannot use Put to write a scalar Variant containing an array to disk. You also cannot use Put to write objects to disk.
If the variable being written is a Variant of VarType 8 (String), Put writes 2 bytes identifying the VarType and 2 bytes indicating the length of the string. It then writes the string data. The record length specified by the Len clause in the Open method must be at least 4 bytes greater than the actual length of the string.
If the variable being written is a dynamic array, Put writes a descriptor whose length equals 2 plus 8 times the number of dimensions, that is, 2 + 8 * NumberOfDimensions. The record length specified by the Len clause in the Open method must be greater than or equal to the sum of all the bytes required to write the array data and the array descriptor. For example, the following array declaration requires 118 bytes when the array is written to disk.
For files opened in Binary mode, the Len clause in the Open method has no effect. Put writes all variables to disk contiguously; that is, with no padding between records.