Eof Function
ཡིག་ཆའི་སྟོན་མདའ་ཡིག་ཆའི་མཇུག་ཏུ་སླེབས་མིན་གཏན་འཁེལ་བྱེད་པ།
Eof (intexpression As Integer)
པུའུ་འར་
Intexpression:ཁ་ཕྱེ་བའི་ཡིག་ཆའི་རྩིས་རྒྱག་གི་ཨང་སྒྲིག་གི་ཧྲིལ་གྲངས་གང་རུང་གི་མཚོན་ཚུལ་ལ་སྤྱོད་པ།
EOF རྟེན་གྲངས་སྤྱད་ནས་ནང་འཇུག་བྱེད་དུས་ཡིག་ཆའི་མཇུག་མཐའ་ལས་བརྒལ་བའི་ནོར་འཁྲུལ་ལས་གཡོགཡོ་ཆོག། ཁྱེད་ཀྱིས་ Input ཡང་ན་ Get བརྗོད་པའི་ཡིག་ཆ་ཀློག་འདོན་བྱེད་དུས་ ཡིག་ཆའི་སྟོན་མདའ་ཀློག་འདོན་བྱས་པའི་ཡིག་ཚེགས་ཀྱི་གྲངས་གཞིར་བཟུང་ནས་མདུན་ལ་སྤོ་འགུལ་བྱེད་དོ། EOFཕྱིར་ལོག་ "True" (-1)
5 ནུས་མེད་ཀྱི་བརྒྱུད་རིམ་འཁོར་སྤྱོད་
52 ནོར་བའི་ཡི་ཆའི་མིང་ངམ་ཨང་སྒྲིག་
Sub ExampleWorkWithAFile
Dim iNumber As Integer
Dim sLine As String
Dim aFile As String
Dim sMsg As String
aFile = "C:\Users\ThisUser\data.txt"
iNumber = Freefile
Open aFile For Output As #iNumber
Print #iNumber, "This is a line of text"
Print #iNumber, "This is another line of text"
Close #iNumber
iNumber = Freefile
Open aFile For Input As iNumber
While Not eof(iNumber)
Line Input #iNumber, sLine
If sLine <>"" Then
sMsg = sMsg & sLine & chr(13)
End If
Wend
Close #iNumber
MsgBox sMsg
End Sub
Sub ExampleWorkWithAFile
Dim iNumber As Integer
Dim sLine As String
Dim aFile As String
Dim sMsg As String
aFile = "~/data.txt"
iNumber = Freefile
Open aFile For Output As #iNumber
Print #iNumber, "This is a line of text"
Print #iNumber, "This is another line of text"
Close #iNumber
iNumber = Freefile
Open aFile For Input As iNumber
While Not eof(iNumber)
Line Input #iNumber, sLine
If sLine <>"" Then
sMsg = sMsg & sLine & chr(13)
End If
Wend
Close #iNumber
MsgBox sMsg
End Sub