Ive just put this together... Its APPEARING to be ok for floats,
but NOT doubles. (Its not intended for doubles, bad concept)

But I do get some discrepancy between the saved and read-back numbers.
Is this expected of floats? Or something else....

Click to reveal..
Code:
#include <litec.h>
#include <default.c>
#define PRAGMA_PATH "@Bits"



void main()
{


	// highscore save
	float highscore 	= 1000000000;
	var highscore_handle;
	highscore_handle = file_open_write("highscores.txt");
		file_var_write(highscore_handle, *((var*)&highscore)	);
	file_close(highscore_handle);
	
	
	
	// highscore load
	float highscore2 = 0;
	var highscore_handle;
	highscore_handle = file_open_read ("highscores.txt");
		var tmp_var = file_var_read(highscore_handle);
		highscore2 = *((float*)&tmp_var);
	file_close(highscore_handle);
	


	
	STRING* tmp1 = str_create("");		str_for_float(tmp1, highscore);
	STRING* tmp2 = str_create("");		str_for_float(tmp2, highscore2);
	
	while(1)
	{
		draw_text("Score SAVED  =", 10,10, vector(100,100,100));
			draw_text(tmp1, 180,10, vector(100,100,100));
	
		draw_text("Score LOADED =", 10,40, vector(100,100,100));
			draw_text(tmp2, 180,40, vector(100,100,100));
		
		wait(1);
	}

}




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial