|
|
Configuration Files dll
#74620
05/18/06 13:57
05/18/06 13:57
|
Joined: Mar 2005
Posts: 309 Germany, Bavaria
Sinthoras
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2005
Posts: 309
Germany, Bavaria
|
hiho I wrote a small configfile dll: It can read values and strings out of a userdefined file. Comments are possible (as shown in the example) with just writing ";" as the first line character. There are three data levels: first one: [head topic] second: #specified topic third: variable / string a short example code:Code:
//load the seconds temp = DLL_cfgload("Settings.cfg", "GameSettings", "Game Time", "seconds"); //load the start string DLL_cfgloadS("Settings.cfg", "GameSettings", "GameStarter", str_cpy(Start_str, "start"));
the string access is a bit tricky because the functions cannot have more than 4 parameters.. you have to take a string containing the cfg-value name for reading the user string. But that shouldnt be a problem.. a short example file:Code:
;---------------------------------------------- [GameSettings]
;time for one run #Game Time hours = 0 minutes = 0 seconds = 5
#GameStarter start = Welcome! rebirth = We'll start another round.. timeout = Timeout.. end = No lifes left
;settings for the player #Player healthpoints = 3 speed = 25 jumpSpeed = 10
Is anyone interested in it?
|
|
|
Re: Configuration Files dll
[Re: Sinthoras]
#74623
05/18/06 20:19
05/18/06 20:19
|
Joined: Aug 2003
Posts: 7,440 Red Dwarf
Michael_Schwarz
Senior Expert
|
Senior Expert
Joined: Aug 2003
Posts: 7,440
Red Dwarf
|
Why do you want to know if it is useful by comment FIRST, if you have ALREADY finished it? Why not just let the people try and THEN say if it is/was useful?
"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
|
|
|
Re: Configuration Files dll
[Re: Sinthoras]
#74625
05/18/06 20:26
05/18/06 20:26
|
Joined: May 2003
Posts: 609 Rattenfängerstadt
Rigoletto
Developer
|
Developer
Joined: May 2003
Posts: 609
Rattenfängerstadt
|
Quote:
the string access is a bit tricky because the functions cannot have more than 4 parameters..
You can use one string seprated by a delimiter for access keywords.
|
|
|
|