ZenHAX

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

All times are UTC




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat May 25, 2019 12:46 pm 

Joined: Sun Jul 10, 2016 11:07 am
Posts: 71
Not really sure if this how really the LINE Variable behaves or a bug, but if there are spaces at the beginning of the text it entirely skips it and goes for the next text no matter how many spaces before the text is


for example like this text...

Code:
          (This is a test)


if i do this...

Code:
log MEMORY_FILE 0 0
get TEXT LINE

put TEXT LINE MEMORY_FILE
get SIZE ASIZE MEMORY_FILE
log 000.txt 0 SIZE MEMORY_FILE


the output will be just

Code:
(This is a test)


and the 10 spaces before the "(This is a test)" is skipped, is this how really the LINE variable works? can't find anything in the read me regarding it. it works fine with Get TEXT string, though I kinda need its delimiting of 0x00, 0x0a and 0x0d, since i have no idea how long each text will be and I want to cut every line break. If this is how it works then no problem, I bet there are lots of ways to get around it.


BTW testes on 0.10.0 and 0.9.2

Thanks in advance.


Top
   
PostPosted: Sun May 26, 2019 2:24 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10569
It's the intended behavior.
The "line" type automatically removes spaces and tabs from the beginning and end of the string (lines 3246 and 3279 of current file.c):


Top
   
PostPosted: Sun May 26, 2019 2:35 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10569
If you want to preserve the spaces you can try with this alternative solution, but it will keep the carriage return ('\r') in it:
getct VAR string '\n'


Top
   
PostPosted: Sun May 26, 2019 9:07 am 

Joined: Sun Jul 10, 2016 11:07 am
Posts: 71
Thanks!

the getct VAR string '\n' maybe perfect for my needs


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 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