Posted By: Ditje
Reading int or float values from a file - 08/24/10 18:06
Hi all,
I have already searched for and expected to find anything, but nothing? I just wanted to write a highscore function in a few minutes - no chance
I have a higscore txt-file (highscores.txt) with the content
10000,9000,8000,...,1000
The only function which could handle my plan seems to be "file_var_read". But if I try the following code var highscore gets no value, even when the file contains only one value. So how can I get int or float values from a text file?
BTW: Good to know for later. Is it possible to read .csv?
Thx
Ditje
I have already searched for and expected to find anything, but nothing? I just wanted to write a highscore function in a few minutes - no chance
I have a higscore txt-file (highscores.txt) with the content
10000,9000,8000,...,1000
The only function which could handle my plan seems to be "file_var_read". But if I try the following code var highscore gets no value, even when the file contains only one value. So how can I get int or float values from a text file?
BTW: Good to know for later. Is it possible to read .csv?
Thx
Ditje
Code:
// highsocre laden var highscore; var highscore_handle; highscore_handle = file_open_read ("highscores.txt"); highscore = file_var_read(highscore_handle); file_close(highscore_handle);