File Read/Write as Rows and Coulmns

BlitzMax Forums/BlitzMax Programming/File Read/Write as Rows and Coulmns

gameshastra(Posted 2007) [#1]
Now i am drawing two lines and storing x and y values in a file like one by one.
for example

file1.txt
312 (first line X)
512 (first line Y)
312 (second line X)
520 (second line Y)
312 (first line X)
530 (first line Y)
...


I could like to store it as rows and columns. i.e.

file1.txt
(first line) (second line )
312 312
512 520
312
530......

i hope u got point.... any idea....

Thanks in advance...............


ziggy(Posted 2007) [#2]
use a separator char, (like space). Read the whole line as a string, and parse the two numeric values.

This should be something like:
x = Int(left(line$,instr(line$," "))
y = Int(mid(line$,instr(line$," ")+1))


To store them as rows and columns,create a string for each line this way:
ToStore$ = x + " " + y

then store this variable.


gameshastra(Posted 2007) [#3]
thank you....