O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 value argument of the FilePut procedure can be any data type except Object. The value argument of the FilePutObject procedure must be of type Object.

  • If filenumber is opened in random access mode, recordnumber refers to the record number; if the file is opened in binary access mode, recordnumber refers to a byte number.

  • Both bytes and records in a file are numbered starting with 1.

  • If recordnumber is 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 recordNumber argument 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 the recordNumber argument, the space up to the end ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required