EOF Function - VB.NET Language In A Nutshell, Second Edition [Book]
Có thể bạn quan tâm
Get full access to VB.NET Language in a Nutshell, Second Edition and 60K+ other titles, with a free 10-day trial of O'Reilly.
There are also live events, courses curated by job role, and more.
Start your free trialName
EOF Function
Class
Microsoft.VisualBasic.FileSystem
Syntax
EOF(filenumber) filenumber (required; Integer)Any valid file number
Return Value
A Boolean indicating when the end of the file has been reached
Description
Returns a Boolean indicating when the end of the file has been reached. Applies to files opened for binary, random, or sequential input.
Rules at a Glance
filenumber must be an Integer that specifies a valid file number.
If a file is opened for binary access, you cannot use EOF with the Input procedure. Instead, use LOF and Loc. If you want to use EOF, you must use FileGet rather than Input. In this case, EOF returns False until the previous FileGet procedure is unable to read an entire record.
Example
Dim fr As Integer = FreeFile( ) Dim sLine As String FileOpen(fr, "c:\data.txt", OpenMode.Input, OpenAccess.Read, _ OpenShare.Default, -1) Do While Not EOF(fr) sLine = LineInput(fr) Console.WriteLine(sLine) LoopProgramming Tips and Gotchas
EOF allows you to test whether the end of a file has been reached without generating an error.
Because you always write data to sequential files at the end of the file, the file marker is always at the end of the file, and EOF will therefore always return True when testing files opened with their modes set equal to either Input or Append.
See Also
LOF Function
Get VB.NET Language in a Nutshell, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.
Start your free trialDon’t leave empty-handed
Get Mark Richards’s Software Architecture Patterns ebook to better understand how to design components—and how they should interact.
It’s yours, free.
Get it now CloseCheck it out now on O’Reilly
Dive in for free with a 10-day trial of the O’Reilly learning platform—then explore all the other resources our members count on to build skills and solve problems every day.
Start your free trial Become a member now CloseTừ khóa » Visual Basic Do Until Eof
-
EOF Function (Visual Basic For Applications) | Microsoft Docs
-
EOF (hàm EOF - Microsoft Support
-
VBA EOF Function - Automate Excel
-
EOF Function - VB & VBA In A Nutshell: The Language [Book]
-
Do Until EOF Loop With Records In VB 2010 - Stack Overflow
-
EOF Function - Visual Basic VBA
-
Do Loop - Code VBA
-
Use Do While To Loop Through Until EOF : Recordset Seek
-
VBA Function EOF
-
Cú Pháp Và Cách Sử Dụng Hàm Input VBA Excel Qua Các Ví Dụ Cụ Thể
-
Do Until EOF Does Not Loop Properly | MrExcel Message Board
-
Read Data From A Text File Using Excel VBA (In Easy Steps)
-
While Not EOF(fn) ... Wend - Visual Basic 4 / 5 / 6 - Bytes