Target Language Compiler | ![]() ![]() |
You should be careful when formatting error message strings. For example, suppose you create a local variable (called message
) that contains text that has new lines.
If you then want to create another variable and prefix this message with the text "RTW Error:", you need to use
will cause a syntax error during TLC execution and your message will not be displayed. This should be avoided. Use the function LibBlockReportError
to help prevent this type of runtime syntax error. The syntax error occurs because TLC evaluates the message, which causes new lines to appear in the assignment statement that appear as unterminated text strings (i.e., the trailing quote is missing).
After formatting your error message, use LibBlockReportError
, a similar function, or %exit
to report your error when it occurs.
Testing Error Messages
It is strongly suggested that you test your error messages before releasing your new TLC code. To test your error messages, copy the relevant code into a test.tlc
file and run
![]() | Fatal (Internal) TLC Coding Errors | TLC Error Messages | ![]() |