Universal Integer Translator

Post any examples or modules that you want to share here
Post Reply
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Universal Integer Translator

Post 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.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
ahcurer
Posts: 7
Joined: Sat Jun 23, 2012 1:55 am

Re: Universal Integer Translator

Post by ahcurer »

Trog,

Nice use of RegExp's ... Keep it going!
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Universal Integer Translator

Post 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!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
ahcurer
Posts: 7
Joined: Sat Jun 23, 2012 1:55 am

Re: Universal Integer Translator

Post 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.
Post Reply