I have found a very little bug reading cfg files (also on pol097)
If I read a cfg value with syntax
var elem := Cstr(elem_cfg.value);
if value contains a number with + sign before like
value +10
when I read
print(value[1]);
the output is
1
instead of
+
The only solution I have found (not a real problem anymore) is use "" syntax like this:
value "+10"
and after
var elem := Cstr(elem_cfg.value);
elem["\""] := " ";
elem["\""] := " ";
[not a bug] cfgfile
Moderator: POL Developer
-
- Adept Poster
- Posts: 85
- Joined: Wed Aug 30, 2006 5:24 pm
- Location: Italy
Re: cfgfile
When you access config elems using the . operator it tries to automatically determine the type.
In your case it is coming out with + saying positive (if you had a - you would get a negative number) the odd part is you are getting 1 (1.0) rather than 10.
If you want it to keep the + sign then you need to use GetConfigString(elem_ref, "value")
In your case it is coming out with + saying positive (if you had a - you would get a negative number) the odd part is you are getting 1 (1.0) rather than 10.
If you want it to keep the + sign then you need to use GetConfigString(elem_ref, "value")
-
- Adept Poster
- Posts: 85
- Joined: Wed Aug 30, 2006 5:24 pm
- Location: Italy
Re: cfgfile
Oh, tanks, sorry for bug declaration