forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


HextoDec ?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
DanTheMan
Contributor
Contributor


Joined: 15 Mar 2002
Posts: 56
Location: Sweden

PostPosted: Mon Mar 18, 2002 1:30 pm    Post subject: HextoDec ? Reply with quote

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
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Mon Mar 18, 2002 2:53 pm    Post subject: Reply with quote

That's an easy one. Wink

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
View user's profile Send private message Send e-mail Visit poster's website
DanTheMan
Contributor
Contributor


Joined: 15 Mar 2002
Posts: 56
Location: Sweden

PostPosted: Mon Mar 18, 2002 3:43 pm    Post subject: Reply with quote

Thank you it helps a lot, (I did'nt now about the "$" in front of a variable)
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Mon Mar 18, 2002 3:50 pm    Post subject: Reply with quote

Glad to help. Very Happy
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Tue Apr 15, 2003 2:51 pm    Post subject: Reply with quote

BTW, what does the $ do?
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Apr 15, 2003 3:06 pm    Post subject: Reply with quote

The $ tells VDS that a it should be converted to a HEX number...
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Apr 15, 2003 3:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Tue Apr 15, 2003 3:22 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group