Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A Question on memory set aside for Zero
#8
(11-30-2024, 05:21 PM)Petr Wrote: It occurred to me, when reading it again, you say it's supposed to be stored as a two-dimensional array. So if you use the binary approach:

Code: (Select All)

Dim Arr(1 To 50, 0 To 44) As Single
ff = FreeFile
Open "DataFile" For Binary As ff
Get ff, , Arr()
Close ff

Screen 13
For x = 1 To 50
    For y = 0 To 44
        PSet (x, y) 'just example...
Next y, x

That would only work if your data file was in the proper format for that.  This isn't.  The way it has to be read is more like:


Dim Arr(1 To 50, 0 To 44) As Single
ff = FreeFile
Open "DataFile" For INPUT As ff
For x = 1 To 50
For y = 0 To 44
INPUT #ff, arr(x, y)
Next y, x
Close

Then you'll have to file in the array and can access each individual element as wanted.
Reply


Messages In This Thread
RE: A Question on memory set aside for Zero - by SMcNeill - 11-30-2024, 05:45 PM



Users browsing this thread: 11 Guest(s)