Page 1 of 1

Universal Integer Translator

Posted: Sun Apr 21, 2013 1:26 pm
by trogluddite
Hi All,
While I was tinkering with Skull's MIDI gadgets, I realised how much I hate converting hex numbers!
So I made this little 'Universal Integer' box that lets you type in values in decimal, hex, octal or binary and just get the integer straight out without having to use the dreaded Windows calculator!
Integer Universal.fsm
(2.63 KiB) Downloaded 1603 times

To make it even easier to use, it's made so that it doesn't care about the case of letters, and you can put whitespace anywhere within number to separate out the digits - there are a load of examples in the schematic.
The conversion is all handled by a single Ruby code block inside, so feel free to pull that out to use with your own custom edit boxes etc.

Re: Universal Integer Translator

Posted: Sat Apr 27, 2013 3:57 am
by ahcurer
Trog,

Nice use of RegExp's ... Keep it going!

Re: Universal Integer Translator

Posted: Sat Apr 27, 2013 3:28 pm
by trogluddite
Thanks,mate - yes indeed, I have been forcing myself to learn (slowly!) how RegExp's work. The power they have for string manipulation is really astounding, but that syntax sure does take some getting used to!

Re: Universal Integer Translator

Posted: Sun Apr 28, 2013 2:17 am
by ahcurer
Yes I couldn't agree more. I have been reading Mastering Regular Expressions Third Edition. The first few chapters really helped me to understand them a little more, always learning though.
I have followed your skills from the SM forum and am in constant amazement on how easy this all seems to come to you.
And now I guess I can follow you over here too.
I spent the $$ and bought RubyMine a while ago to help me learn the Ruby lang. I like the IDE thing as I come from the VC++ environment. Even though Ruby is an interpreted lang, I am still impressed with it (OCRA will make an .exe). Can do a lot with only a little.

Cheers trog man.