Name
FileGet, FileGetObject Procedures
Class
Microsoft.VisualBasic.FileSystem
Syntax
FileGet(FileNumber, Value, RecordNumber) FileGetObject(FileNumber, Value, RecordNumber)
-
FileNumber Use: Required
Data Type: Integer
Any valid file number
-
Value Use: required
Data Type: Any (see the first two items in “Rules at a Glance”)
Variable in which to place file contents
-
RecordNumber Use: Optional
Data Type: Integer
The location at which reading begins
Description
Copies data from a file on disk into a variable
Rules at a Glance
For the
FileGetprocedure, the variable can have one of the following data types:Array Boolean Byte Char Date Decimal Double Integer Long Short Single String
For the
FileGetObjectprocedure, the variable must be of type Object.For files opened in Random mode,
RecordNumberrefers to the record number in the file.For files opened in Binary mode,
RecordNumberrefers to the byte number within the file.The number of bytes read by the
FileGetprocedure is governed by the data type ofValue. The following is the number of bytes read by each data type:Data type
Bytes read
Boolean
2
Byte
1
Char
1
Date
8
Decimal
8
Double
16
Integer
4
Long
8
Short
2
Single
8
String
Len(
string)Note that the number of bytes read by a String variable depends on the length of the string. Hence, a string must be initialized to the desired size before calling the
FileGetprocedure.The position of the first record or byte within a file is always 1.
When a record or a number of bytes is read ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access