ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Mon Jun 17, 2019 12:58 am

All times are UTC




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Jun 09, 2019 9:35 am 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 235
i want to know how can i convert a string to value (hex-decimal)
for example: i read a number in a xml file (this is the xml part: <width="20">)
i read 20 with getdstring, but how can i convert to decimal? (decimal, i mean \x14)

and how can i convert a decimal to string for output to file? (convert \x14 to 20 for output file)


Top
   
PostPosted: Sun Jun 09, 2019 10:01 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10535
Strings and numbers are quite abstract in quickbms.
Your variable can be already used as a number but if you want to be 100% sure try the following:
math VAR = VAR
or
set VAR long VAR # not suggested as far as I remember


Top
   
PostPosted: Sun Jun 09, 2019 10:02 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10535
When working with output filenames I suggest to use the Printf operator of String:
string NAME p "%d" VAR


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC


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 post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited