Author Topic: {TXTLEN:Text-file} is wrong  (Read 1708 times)

nepomuk

  • Newbie
  • *
  • Posts: 11
{TXTLEN:Text-file} is wrong
« on: November 19, 2022, 10:34:09 AM »
Hi all, I have a question or a problem with the command {TXTLEN:log-file name} or similar commands
e.g. {TXTLASTPOS:...}. The function is executed but the position and the file length are not correct.
(I want to find a certain word in the Journal.log of Elite Dangerous)
What am I doing wrong?  ::)

EDIT:
Ohhh, I have found my mistake. Sorry, if anyone has thought about it. I play Elite in German.
In German there are the umlauts ä, ö and ü. These are to blame for my mistake.
Additionally, it is irritating that the curly brackets ( "{" and "}" ) are not counted.
But with these circumstances, the file length or the number of characters fits.  ;D
« Last Edit: November 19, 2022, 01:25:50 PM by nepomuk »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2824
Re: {TXTLEN:Text-file} is wrong
« Reply #1 on: November 19, 2022, 01:31:51 PM »
I started to reply with basic instructions, but I think you've got the idea.

Note that if your text contains curly brackets (as you stated), VA will treat the contents as a token.  To get around that part, you'll need to select the, 'Do not render tokens in variable values' option.  Of course, I don't think that is followed when using the length/pos tokens...  I think you would need to escape the brackets first by using |{  and   |}.

Also, if your text contains %, VA will try to expand environment variables (which may have an impact).  Now that I'm looking at this, that should be an option as well.


Seems real messy, but these are for use with simple situations.  For more complex stuff (like this situation, possibly), you'd want to take a look at inline functions.