Non-Printing Characters

One of the reasons scripts don't work is because one or more non-printing characters have crept into the script. There are multiple reasons this happens, including:

You thought it was bad enough to try to understand Iptscrae. Now you have to worry about things you can't even see. ;-)

 

What can I do?
The answer sounds both obvious and impossible - make the non-printing characters visible and then delete them.

Some text editors have options which cause non-printing characters to be displayed. Copy the script to one of these and manually scan for non-printing characters. If you find any, delete them. Then copy the corrected script back to your palace.

If you can't find the problem with a text editor, use the error message generated by the newer clients and find the line where the error is indicated. Retype the line and maybe a line on either side of it. A lot of times this will solve the problem.

 

What word processors should I use?

For the Mac, a good program to use is BBEdit. Before pasting the script into BBEdit go to Edit - Preferences and set it to "Show Invisibles". Unfortunately, I'm not familiar with PC programs but I'd bet if you asked around you'd find one.

 

Exercise 3-1:
The following script has non-printing characters. Determine where they are and delete them:

ON SELECT
{
{ 2 GETSPOTSTATE 1 + 2 SETSPOTSTATELOCAL } { 0 2 SETSPOTSTATELOCAL } 2 GETSPOTSTATE 3 < IFELSE
"Can you find the error in this script?" LOGMSG
}