Michael_Lowry

Using special characters like tab in UC4 scripts

Discussion created by Michael_Lowry on Mar 31, 2016
Latest reply on Mar 31, 2016 by Michael_Lowry
Recently I was looking for a way to strip leading and trailing white space characters from UC4 strings. STR_TRIM was my first hope, but it removes only spaces, not tabs. I began writing a script that would use STR_FIND to search for tab characters, but immediately ran into a problem: I could find no way to paste a tab character into the script editor. The UC4 UI seems to automatically replace pasted tabs with a pair of spaces. I worked around this by inserting the tab into a static VARA object.
:SET &TAB# = GET_VAR(UC0.MAL.SPECIAL_CHARACTERS.VARA,"tab")
:SET &STRING_WITH_TAB# = "Hello, world.&tab#"
This works fine, but I assume there must be more straightforward way. Any ideas?

Outcomes