| View previous topic :: View next topic |
| Author |
Message |
melted.marsbar Member

Joined: 10 Oct 2007 Posts: 2
|
Posted: 10/10/07 10:12 Post subject: Changing Textfiles |
|
Hey guys, my first post! I'm doing Delphi programming at school at the moment - I'm pretty good, but I do have a couple of questions from time to time. So I thank you in advance for your assistance.
First one for today
How do I change the data in textfiles? I know how to add data to it and completely clear it, but how to I write over the text on a line? Say I have this text file:
| Code: |
John Smith
100
200
300 |
How do I change "200" to say "400"?
Thanks! melted.marsbar |
|
|
|
|
|
 |
Kambiz Administrator


Joined: 07 Mar 2003 Posts: 1347 Location: Tehran, Iran
|
Posted: Yesterday Post subject: |
|
As a text file, you have to read the entire file, change the line you want, and write the entire data back to file. |
_________________ Kambiz
 |
|
|
|
 |
melted.marsbar Member

Joined: 10 Oct 2007 Posts: 2
|
Posted: Yesterday Post subject: |
|
Ah okay. Well in that case, I shall use an array =) Thanks! |
|
|
|
|
|
 |
|