Re: R: R: [AD] Allegro 5 new config routines, alpha 1 |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Angelo Mottola wrote:
> What worries me is that when you set a variable from a program as
> belonging to hex for example, and you write the config to a file, when
> you reload it next time, you probably want that variable to still be
> an hex, without conversions.
Sorry, what conversions? In my mind, we store everything only as a
string in memory, so the config routines do not know anything about
types. Conversion is done from integer to string when you call
set_config_int() or set_config_hex(), from string to integer when you
call get_config_int(), and not at all when you call get_config_string().
Decimal, octal and hexadecimal integers are distinguished by the
prefixes nothing, 0, or 0x. So set_config_hex("foo",18193) just saves
the string "0x4711", get_config_int("foo") returns 18193, and
get_config_string("foo") returns "0x4711". Or did I overlook something?
--
Sven Sandberg svsa1977@xxxxxxxxxx home.student.uu.se/svsa1977