Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I NEED HELP!
#1
My project consists of a file in which when a person wants to erase something the line gets erased from the file.
I dont know how to do this...can someone help?


It goes like this
OPEN "file.dat" for Output as #1
FOR I = 1 to 10
INPUT NAME$(I)
WRITE #1,NAME$(I)
NEXT I
CLOSE #1


Now i need to delete 1 of the names.....ne1 know how to do it?
Reply
#2
The simplest way is to read in all the lines, delete the file, then write all the lines back to the file, except the one you want to delete.
Reply
#3
Use LINE INPUT 1# and PRINT #1 instead of INPUT #1 and WRITE #1 so that you can read entire lines, not just variables.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)