Author Message
PepsiHog
Macro Veteran

Joined: 08 Apr 2009
Posts: 274
Location: Florida
Reputation: 143.2

 Posted: Sat Feb 18, 2012 7:08 pm    Post subject: Hex To Decimal Hello Everyone, I have something in mind for this macro. Until today, I had NO idea how to do this. Now I have learned how and I wrote a macro that I hope will be usefull to some of you. ENJOY!! This macro prompts for a hex number and then calculates what the decimal number is. let>NewValue= let>matches=0 let>pwr=0 let>Total=0 let>asd=0 let>simi=; Input>Hex,Enter a HEX value UpperCase>Hex,Hex RegEx>[0-9a-fA-F],Hex,0,Hexidecimal,matches,0 Repeat>matches let>Temp=Hexidecimal_%matches% ConCat>NewValue,Temp ConCat>NewValue,simi sub>matches,1 Until>matches=0 RegEx>;\$,NewValue,0,Values,nm,1,,NewValue StringReplace>NewValue,A,10,NewValue StringReplace>NewValue,B,11,NewValue StringReplace>NewValue,C,12,NewValue StringReplace>NewValue,D,13,NewValue StringReplace>NewValue,E,14,NewValue StringReplace>NewValue,F,15,NewValue Separate>NewValue,;,Value let>Count=%Value_count% Repeat>asd add>asd,1 let>hx={Power(16,%pwr%)} let>digit=Value_%asd% let>eq=%digit%*%hx% let>Total=%Total%+%eq% add>pwr,1 Until>asd=%Count% mdl>%Total% Later, I plan to post a macro to do the opposite. Decimal to Hex. PepsiHog_________________MS v12 WinXP sp3 PepsiHog. Yep! I drink LOTS of Pepsi! AND enjoy programming. (That's my little piece of heaven!) The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros! Did this message help you? If so please reward the poster with Reputation Points? Reward Points
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT Page 1 of 1

 Jump to: Select a forum General and Info----------------The Water CoolerNews and Update Announcements Macro Scheduler----------------General DiscussionTechnical / ScriptingBeginnersSoftware TestingScripts and TipsEnhancement SuggestionsMacro Scheduler BetaMacro Scheduler ConsultantsTranslation
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum