Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Weird Get TEXT LINE behavior

Featured Replies

  • Author
  • Localization

happydance, posted Sat May 25, 2019 12:46 pm (48014)


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.
  • Author
  • Localization

aluigi, posted Sun May 26, 2019 2:24 am (48030)


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):
  • Author
  • Localization

aluigi, posted Sun May 26, 2019 2:35 am (48033)


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'
  • Author
  • Localization

happydance, posted Sun May 26, 2019 9:07 am (48046)


Thanks!

the getct VAR string '\n' maybe perfect for my needs
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.