| View previous topic :: View next topic |
| Author |
Message |
DanTheMan Contributor


Joined: 15 Mar 2002 Posts: 56 Location: Sweden
|
Posted: Mon Mar 18, 2002 1:30 pm Post subject: HextoDec ? |
|
|
Cannot find an easy way to do a Hex2Dec conversion. ( The reverse
of @hex() . Are there any DLL:s to do this ? |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Mon Mar 18, 2002 2:53 pm Post subject: |
|
|
That's an easy one.
| Code: |
DIALOG CREATE,HEX to Dec,-1,0,240,102
DIALOG ADD,EDIT,EDIT1,12,36,180,19,
DIALOG ADD,TEXT,TEXT1,14,10,34,13,Hex:
DIALOG ADD,EDIT,EDIT2,42,36,180,19,
DIALOG ADD,TEXT,TEXT2,44,10,23,13,Dec:
DIALOG ADD,BUTTON,Convert,74,88,64,24,Convert
DIALOG SHOW
:evloop
Wait event
%e = @event()
goto %e
:convertbutton
%%in = @dlgtext(edit1)
%t = @sum($%%in, 0)
dialog set,edit2,%t
goto evloop
:Close
stop
|
Does that help? _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
DanTheMan Contributor


Joined: 15 Mar 2002 Posts: 56 Location: Sweden
|
Posted: Mon Mar 18, 2002 3:43 pm Post subject: |
|
|
| Thank you it helps a lot, (I did'nt now about the "$" in front of a variable) |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Apr 15, 2003 2:51 pm Post subject: |
|
|
BTW, what does the $ do? _________________
 |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Tue Apr 15, 2003 3:07 pm Post subject: |
|
|
BTW. I once made a little tool to convert HEX IP addresses to normal numbers and vice versa... Maybe you can use it:
| Code: | %%which = @input("IP-to-Heximal (1) or Heximal-to-IP (2) ?")
if @equal(%%which,1)
%%ip = @input("IP address")
goto iptoheximal
else
%%heximal = @input("Heximal number")
goto heximaltoip
end
:iptoheximal
option fieldsep,.
parse "%1;%2;%3;%4",%%ip
%%heximal = @substr(@hex(%1),3,4)@substr(@hex(%2),3,4)@substr(@hex(%3),3,4)@substr(@hex(%4),3,4)
clipboard set,%%heximal
info Copied to clipboard: @cr()%%ip = %%heximal
exit
:heximaltoip
%1 = @diff($@substr(%%heximal,1,2),0)
%2 = @diff($@substr(%%heximal,3,4),0)
%3 = @diff($@substr(%%heximal,5,6),0)
%4 = @diff($@substr(%%heximal,7,8),0)
%%ip = @input(IP address:,%1.%2.%3.%4)
clipboard set,%%ip
info Copied to clipboard: @cr()%%ip = %%heximal
exit |
_________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Apr 15, 2003 3:22 pm Post subject: |
|
|
I'm trying to convert Hex to Asci characters.
I'm looking at a chart here http://www.asciitable.com/ which displays all the values. I also need the extended ascii codes.
So lets say I have 48656C6C6F which will be outputed to Hello.
Do you have a quick script for that? _________________
 |
|
| Back to top |
|
 |
|
|
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 You can attach files in this forum You can download files in this forum
|
|