[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

EOF  - easy question

Posted on 2002-06-17
5
Medium Priority
?
337 Views
Last Modified: 2010-05-02
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

EOF

I need to change this file to this:

text here
text here
text here

EOC

More Text
More Text

EOF

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.

Thanks,

saki

0
Comment
Question by:sakibomber
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Expert Comment

by:kafzaal
ID: 7085520
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

kashif
0
 
LVL 1

Expert Comment

by:HelixDaKat
ID: 7085528
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
else
    'Do something else
end if
0
 
LVL 2

Expert Comment

by:AndySulz
ID: 7087716
eof stands for "End of File"
0
 
LVL 3

Accepted Solution

by:
PNJ earned 200 total points
ID: 7088022
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.
[Section]
Entry=your value here

Use WritePrivateProfileString to put/overwrite values.
(Using the Windows Registry is better - but harder to use)
0
 

Author Comment

by:sakibomber
ID: 7091827
thanks :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question