EOF - easy question

IS EOF a keyword?  I have an INI file that has text in it.  At the end of the file is an EOF.  The code uses the While Not EOF.   Heres what the file looks like now:

text here
text here
text here


I need to change this file to this:

text here
text here
text here


More Text
More Text


So in the code....can I just say...While Not EOC?  Or is EOF a keyword????   Otherwise I think I could just parse the string.



Who is Participating?
PNJConnect With a Mentor Commented:
Interesting that the words "INI file" were used. In which case you really should be using GetPrivateProfileString to get the values. You then don't read the file at all but use:

Function GetIniData(sSection As String, sEntry As String) As String
   Dim sIniData as String, nTemp as Integer
   sIniData = String$(128, 0)
   nTemp = GetPrivateProfileString(sSection, sEntry, "DEFAULT IF NOT FOUND", sIniData, 127, apIniFile)
   GetIniData = Trim$(Left$(sIniData, nTemp))
End Function

See (eg) WIN.INI for the format.
Entry=your value here

Use WritePrivateProfileString to put/overwrite values.
(Using the Windows Registry is better - but harder to use)
if you are reading the file then the you must have used
line input #1,abc

it means that the abc variable will store the value of line and then you have to check the loop as
while not abc = "EOF"
or whatever you want

EOF when read from the INI file is NOT a keyword, but a String. "EOF"  

EOF in code IS a Keyword:  EOF(1)

So if your looking for this line when looping through the file you would just put:  (If your using Line Input)

Line Input #1,strLine

if strline = "EOF" then
    'Do something
    'Do something else
end if
eof stands for "End of File"
sakibomberAuthor Commented:
thanks :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.