|
-
Apr 7th, 2003, 08:29 AM
#1
Thread Starter
Fanatic Member
Reading and Writing to/from files in the same operation [RESOLVED]
Using the Open statement I can open text files for reading from, or writing to but not at the same time. Does anyone know how?
I want to scan the lines of an existing text file and when I find certain things, I want to insert new lines in the appropriate places.
Last edited by simonm; Apr 7th, 2003 at 08:51 AM.
Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment. 
-
Apr 7th, 2003, 08:31 AM
#2
You can open it for Binary, and use Put and Get.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Apr 7th, 2003, 08:36 AM
#3
Thread Starter
Fanatic Member
"Put" and "Get"?
VB doesn't recognise them and I can't find any reference to them in my MSDN library.
We are talking VB here, aren't we?
Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment. 
-
Apr 7th, 2003, 08:40 AM
#4
This is my VB6 code using PUT
VB Code:
DatNr = FreeFile
DateiName = ReplayDateiPfad + "\Repl" + ReplayDatei + ".rp2"
Open DateiName For Binary As DatNr
Put DatNr, 1, Playtime
l = Seek(DatNr)
Put DatNr, i + 1, ChangeTime
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
-
Apr 7th, 2003, 08:41 AM
#5
They are statements.
VB Code:
Dim s As String
s = Space$(5)
Open "c:\test.txt" For Input As #1
Get #1,,s 'Should get 5 bytes of text
Put #1,,"Test" 'Should write "Test" where the marker is positioned
Close #1
Its been a while since I've used them, I think that is right.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Apr 7th, 2003, 08:50 AM
#6
Thread Starter
Fanatic Member
Yeah thanks. 
I see what you mean now.
It's just a nightmare finding what you want in the MSDN library sometimes...
Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment. 
-
Apr 7th, 2003, 08:53 AM
#7
Originally posted by simonm
It's just a nightmare finding what you want in the MSDN library sometimes...
It works perfectly fine...as long as you know exactly what you want and where to find it.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
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
|