April 29, 2024, 10:46:40 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Constant Converter

Started by Bruce Peaslee, January 20, 2006, 03:58:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bruce Peaslee

January 20, 2006, 03:58:14 PM Last Edit: January 24, 2006, 10:13:28 AM by peaslee
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.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Parker

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.

Bruce Peaslee

Ouch!

Well, it does do that, although typing in just "80" seems to work. Must be a problem with my string manipulations.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Parker

80 isn't the same as 0x80 ;)

Unless you're automatically converting it from hex, but 0x80 is 128 in decimal.

Bruce Peaslee

The program treats it as a hex character string which is then converted to an integer.

Still looking for the bug  :-\
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Bruce Peaslee

January 20, 2006, 06:22:48 PM #5 Last Edit: January 20, 2006, 10:13:16 PM by peaslee
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.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Ionic Wind Support Team

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.
Ionic Wind Support Team

Bruce Peaslee

Another couple of bug fixes now uploaded as *.src file in the original post.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles