01-30-2003, 03:08 AM
WOW!!
NOOO!!
KILL erases files, not records inside a file. To delete a record from a secuential file, you have to open it, read it, and write it again to an emplty file without adding that record. For example, let's say that you want to erase value "99" from an integer sequential file (for example). The file is NUMBERS.DAT
NOOO!!
KILL erases files, not records inside a file. To delete a record from a secuential file, you have to open it, read it, and write it again to an emplty file without adding that record. For example, let's say that you want to erase value "99" from an integer sequential file (for example). The file is NUMBERS.DAT
Code:
OPEN "NUMBERS.DAT" FOR INPUT AS #1
OPEN "NUMBERS.2" FOR OUTPUT AS #2
WHILE NOT EOF(1)
INPUT #1, number%
IF number% <> 99 THEN PRINT #2, number%
WEND
CLOSE
' Now we KILL the original file
KILL "NUMBERS.DAT"
' And we change the name of the new file:
NAME "NUMBERS.2" AS "NUMBERS.DAT"
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i