PDA

View Full Version : How to read global variables from the .ini file?



plokolp
05-10-2005, 07:43 PM
Hi there,

I think I must be missing something. Please help.

I would like to store a global number in the .ini file so that when DS loads, the global is automatically set to it.

What I get is the value that DS last used.

I thought that when DS loads, it would check the .ini file and then set the globals. Is this right?

Thanks.

Chandy Navarata
05-12-2005, 10:16 AM
That's right but the Player will save the last value of the variable when you close the demo hence reloading this value the next time you play the demo. If you just wish to preload the variables with a certain value then you don't need to persist them instead set the initial value of the variable in the property dialog.

Regards,

plokolp
05-12-2005, 06:53 PM
Hmmm, thanks for the reply. What I'm trying to do is pre-load the variables by editing the .ini file and having the global variables use these, however this does not work.

It seems that the global variables are stored elsewhere (perhaps in the .dsb), and the .ini file is just a place so that humans can look at them.

I worked around this problem by using regular variables instead of global variables. These can also persist to the .ini but the difference is that DemoShield will read from the .ini file.