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.
Code: Select all
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%
PepsiHog