ZenHAX
https://zenhax.com/

converting hex to sting question
https://zenhax.com/viewtopic.php?f=11&t=8996
Page 1 of 1

Author:  happydance [ Thu Dec 06, 2018 8:26 am ]
Post subject:  converting hex to sting question

just a quick and noob question.

when I write the code like this which just gets the hex number of files and put it on a memory file to be made as text I always get a 0x0 at the end of the converted decimal number.

Image

Code:
log MEMORY_FILE 0 0
get FILENUM long
put FILENUM string MEMORY_FILE
get SIZE ASIZE MEMORY_FILE2
log test.txt 0 SIZE MEMORY_FILE2



I plan on getting the value of the number of files, the value of dialog id convert it to decimal and also rip some text strings to the output file.


I'm trying to do something like this as the output file

10 <--- file number
01 Hello there. <--- dialog ID and text
02 I'm a noob\natdoing this thing. <--- dialog ID and text
03 thanks for the help.

Author:  aluigi [ Thu Dec 06, 2018 11:19 am ]
Post subject:  Re: converting hex to sting question

I think you want to use "line" instead of "string".

put FILENUM line MEMORY_FILE

While for the strings try:

string TMP p "%02d %s" ID STRING
put TMP line MEMORY_FILE

Author:  happydance [ Fri Dec 07, 2018 4:16 am ]
Post subject:  Re: converting hex to sting question

thanks!

put FILENUM line MEMORY_FILE

works great!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/