Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,295 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Read files. Ini #228453
09/19/08 17:25
09/19/08 17:25
Joined: Sep 2008
Posts: 2
Spain
F
fell Offline OP
Guest
fell  Offline OP
Guest
F

Joined: Sep 2008
Posts: 2
Spain

Read files. Ini

know how you can read the files. Ini, and I tried to do with the Apis:

GetPrivateProfileString
WritePrivateProfileString

But I have problems using these APIs in the lite-c, I get a lot of mistakes, if algien knows how to read. Ini or could help, I would appreciate.

Re: Read files. Ini [Re: fell] #228480
09/19/08 21:05
09/19/08 21:05
Joined: Aug 2008
Posts: 17
P
PiLX Offline
Newbie
PiLX  Offline
Newbie
P

Joined: Aug 2008
Posts: 17
AUM 69 has an example of reading and writing to a .ini file (the menu example)

EDIT: unless you are using pure mode... sorry this might not help.

Re: Read files. Ini [Re: PiLX] #228527
09/20/08 06:32
09/20/08 06:32
Joined: Aug 2008
Posts: 22
R
razvan252 Offline
Newbie
razvan252  Offline
Newbie
R

Joined: Aug 2008
Posts: 22
Code:
function read_settings()  // save user defined settings to file
{
	file_handle = file_open_read("settings.ini");	// open settings file
	
	if (file_handle) // only continue if file exists, else use default settings
	{	
	video_screen = file_var_read (file_handle); // set video_screen	
	video_mode	=	file_var_read (file_handle);//set resolution
	video_gamma = file_var_read (file_handle); // set video_gamma to value from file
	master_vol = file_var_read (file_handle); // set master_vol to value from file
	camspeed = file_var_read (file_handle);
	file_close(file_handle); // close the file, we don't need it again
   }
   else { return;} // else stop loading and use default values
}

function write_settings()  // save user defined settings to file
{
	file_handle = file_open_write ("settings.ini");		
	file_var_write (file_handle, video_screen);
	file_var_write (file_handle, video_mode);
	file_var_write (file_handle, video_gamma);
	file_var_write (file_handle, master_vol);
	file_var_write (file_handle, camspeed);
	file_close(file_handle);
}

//use default opts
	video_gamma = 100; 
	master_vol = 100;
	video_screen = 1;
	video_mode = 9;
	camspeed	= 6;
	
	read_settings();


i found this in some post

Re: Read files. Ini [Re: razvan252] #228562
09/20/08 15:39
09/20/08 15:39
Joined: Sep 2008
Posts: 2
Spain
F
fell Offline OP
Guest
fell  Offline OP
Guest
F

Joined: Sep 2008
Posts: 2
Spain
Thanks PiLX, razvan252 .....


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1