|
-
Mar 25th, 2000, 10:20 AM
#1
Thread Starter
Lively Member
there is a text file containing several lines of text, how do i use the seek statement to obtain the writing position for a certain place corrosponding to the string character i want??
Eg.
///////
this is a test ok
second line
forth line, and the last line.
/////////
how do i get the above to appear like the below using the
seek and put statment??
///////
this is a test ok
second line
forth line, and the las[new string entry]t line.
/////////
thanks in advance 
-
Mar 25th, 2000, 05:42 PM
#2
transcendental analytic
I don't know how you want this. You can't use the the put and seek to do this. Seek will get the current position where to write next and Put will overwrite. But for your example:
------------------------
fnum = FreeFile
Open filename For Binary As fnum
file = Space(LOF(fnum))
Get #fnum, , file
Close fnum
file = Left(file, pos) & newtext & Mid(file, pos + 1)
Open filename For Binary As fnum
Put #fnum, , file
Close fnum
-------------------------
Hope this helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|