IonicWind Software

Aurora Compiler => Software Projects => Topic started by: Bruce Peaslee on January 20, 2006, 03:58:14 PM

Title: Constant Converter
Post by: Bruce Peaslee on January 20, 2006, 03:58:14 PM
I've always wished that the style constants generated by the dialog editor would have the text constants and not the hex numbers -- "ABS_FLAT" as opposed to 0x00008000. If and until that happensÂÃ,  ;) I will use the attached program to convert the hex numbers into something more readable. As the listing is long, I will upload (as a txt file).

Paste the hex number into the dialog's edit control, press convert. If you want the result put back into your code, press clipboard to get it there for pasting.

Edit: found the bug - reload if interested.
Title: Re: Constant Converter
Post by: Parker on January 20, 2006, 05:24:36 PM
If I type in "0x80", select "Dialog", and click "Convert", it crashes. Otherwise it's a pretty cool program.

Also I wonder if Paul could make the forum accept .src files.
Title: Re: Constant Converter
Post by: Bruce Peaslee on January 20, 2006, 05:36:35 PM
Ouch!

Well, it does do that, although typing in just "80" seems to work. Must be a problem with my string manipulations.
Title: Re: Constant Converter
Post by: Parker on January 20, 2006, 05:45:39 PM
80 isn't the same as 0x80 ;)

Unless you're automatically converting it from hex, but 0x80 is 128 in decimal.
Title: Re: Constant Converter
Post by: Bruce Peaslee on January 20, 2006, 05:52:11 PM
The program treats it as a hex character string which is then converted to an integer.

Still looking for the bug  :-\
Title: Re: Constant Converter
Post by: Bruce Peaslee on January 20, 2006, 06:22:48 PM
OK - found the bug. Was one-off in a string function. I'm not sure why it crashed -- as opposed to just giving the wrong result -- but it appears to work now.

Thanks for testing it.
Title: Re: Constant Converter
Post by: Ionic Wind Support Team on January 20, 2006, 11:15:57 PM
Quote from: Parker on January 20, 2006, 05:24:36 PM
Also I wonder if Paul could make the forum accept .src files.

Done.  Also accepts .inc too.
Title: Re: Constant Converter
Post by: Bruce Peaslee on January 24, 2006, 10:14:25 AM
Another couple of bug fixes now uploaded as *.src file in the original post.