PDA

View Full Version : Non-Printable Characters



rich_is_bored
05-21-2004, 02:16 PM
In the event you want to write an Lscript capable of exporting to an Ascii file format that is tab delimited, you write the non-printable character by substituting them with this...

\t

So now that I know how to write the tab character to a file, are there other special cases that allow you to write characters like quotation marks, backslashes, forwardslashes, ect? If so, what are they and how come they aren't documented in the manual?

I think I'm starting to understand why there are so few import/export plugins.

rich_is_bored
05-21-2004, 02:37 PM
I did some googling and the official term is called ...

Escape notations (http://www.cs.tut.fi/~jkorpela/chars.html#esc)

Lynx3d
05-21-2004, 02:47 PM
Well at least the \\ for \ (backslash) and \" for " (quotation marks) work with the info() function...
i don't really use LScript, but some more from C would be \n for newline and \0 for string termination (just a null-byte) and some more you'll probably never need :)

rich_is_bored
05-21-2004, 02:52 PM
Thanks. I just now found a small list of them for C++ and was thinking they might carry over to LScript.


Sequence Name

\a .................... Alert (bell)
\b .................... Backspace
\f .................... Formfeed
\n .................... Newline
\r .................... Carriage return
\t .................... Horizontal tab
\v .................... Vertical tab
\? .................... Literal question mark
\' .................... Single quotation mark
\" .................... Double quotation mark
\\ .................... Backslash
\ddd .................. ASCII character in octal notation
\xdd .................. ASCII character in hex notation
\0 .................... Null character

Still, it's frustrating as all hell that Newtek didn't bother including a section about this in the LScript reference.

NanoGator
07-20-2004, 07:17 PM
Originally posted by rich_is_bored
Still, it's frustrating as all hell that Newtek didn't bother including a section about this in the LScript reference.

Alternatively, if you want to make your code more readable, you can assign those codes to a variable. I did that for a function I just wrote that creates expressions.



qq="\""; // -- " -- Double Quote
CommandExec = ("GE_CreateExpression "+ qq + ExpressionName + qq + " " + qq + ExpressionEquation+qq);

CommandInput(CommandExec);



I had problems with Layout crashing if I used the \" code, but it's possible I did something else wrong. This seemed safer.