Name
FilePut, FilePutObject Procedures
Class
Microsoft.VisualBasic.FileSystem
Syntax
FilePut(filenumber, value, [recordnumber]) FilePutObject(filenumber, value, [recordnumber])
-
filenumber(required; Integer) Any valid file number
-
value(required; any (see the first item in Section ) The name of the variable containing the data to be written to the file
-
recordnumber(optional; Integer) Record number (for random access) or byte number (for binary access) at which to begin the write operation
Description
Writes data from a program variable to a disk file
Rules at a Glance
The
valueargument of the FilePut procedure can be any data type except Object. Thevalueargument of the FilePutObject procedure must be of type Object.If
filenumberis opened in random access mode,recordnumberrefers to the record number; if the file is opened in binary access mode,recordnumberrefers to a byte number.Both bytes and records in a file are numbered starting with 1.
If
recordnumberis omitted, the next byte or record to be written will be placed at the position immediately after the position pointed to by the last FileGet or FilePut procedure, or by the last Seek function.If you have opened the file in Random mode, it is important to ensure that the record length specified in the
recordNumberargument of the FileOpen procedure matches the actual length of the data being written. If the length of the data being written is less than that specified by therecordNumberargument, the space up to the end ...