Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HELP!!!!
#5
I think I know what you are trying. You are trying to read a file to memory, then change some elements, the write the file again... I guess the elements are numbers, and that the 500 cells array is big enough. If this doesn't work, then tell me which kind of file you are trying to open.

Code:
DIM Info%(500)
OPEN "thefile.fil" FOR INPUT AS #1
index%=0
WHILE NOT EOF(1)        ' While not end of file 1
   INPUT #1, Info%(index%)   ' Read from file.
   index% = index% + 1         ' next time, next array cell.
WEND
CLOSE #1
' Now the data in the file is in memory. Let's change values
' 6, 7, 8 and 9. I dunno what you want to do with your data,
' so I'll just put random values
FOR i%=6 TO 9
   Info%(i%) = INT(RND*10)+1
NEXT i%
' Now write the file:
OPEN "thefile.out" FOR OUTPUT AS #1
' Note that index% is the number of records plus 1, so...
FOR i%=0 TO index%-1
   PRINT #1, Info(i%)
NEXT i%
CLOSE #1
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Messages In This Thread
HELP!!!! - by Orisha - 02-01-2003, 12:52 AM
HELP!!!! - by na_th_an - 02-01-2003, 01:18 AM
HELP!!!! - by Orisha - 02-01-2003, 01:20 AM
HELP!!!! - by Orisha - 02-01-2003, 01:48 AM
HELP!!!! - by na_th_an - 02-01-2003, 02:42 AM
HELP!!!! - by Orisha - 02-01-2003, 02:53 AM
HELP!!!! - by toonski84 - 02-01-2003, 03:11 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)