Author Topic: Match a Tab character in TXTPOS, TXTLASTPOS or TXTOCCURRENCES ?  (Read 1102 times)

DevGnoll

  • Newbie
  • *
  • Posts: 9
I have an external command that produces a line of text with tabs separating interesting values.   I want to use TXTPOS and  TXTSUBSTR to hack it up and set text variables appropriately.

I've had luck splitting up text into lines by looking for {NEWLINE} in the text,  how do I find a tab?   The doc's don't include a {TAB} text token.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4758
  • RTFM
Re: Match a Tab character in TXTPOS, TXTLASTPOS or TXTOCCURRENCES ?
« Reply #1 on: July 02, 2021, 12:31:25 PM »
For more advanced splitting of text, I'd personally use an inline function for the whole thing and actually split the input using String.Split()

If you'd rather use tokens, you can use an inline function solely to set a text variable to a tab character, which you can then use for the "textVariableOf" parameter of the "{TXTPOS:}" token.

E.G.
Code: [Select]
Inline C# Function: Set tab variable
Write [Blue] '{TXTSUBSTR:myVariable:0:{TXTPOS:tabChar:myVariable:}}' to log

Where "Set tab variable" contains
Code: [Select]
public class VAInline
{
public void main()
{
VA.SetText("tabChar", " ");
}
}