THROW
Syntax THROW word
 
Explanation THROW returns control to the CATCH statement with a matching first input, or to the CATCH TRUE statement if no matching CATCH statement is found. See ERROR for a list of predefined runtime errors which can be thrown.

Examples The following example asks you to type a name. If you type a number instead, the program prints a message and continues.

TO NAMIT 
     CATCH "NOTNAME [NAMIT1 STOP] 
     NAMIT 
END
NAMIT defined
TO NAMIT1 

     PRINT [PLEASE TYPE A NAME] 
     MAKE "NAME READ 
     IF NUMBER? :NAME [PRINT [THAT'S A NUMBER, NOT A NAME] THROW "NOTNAME] 
     PRINT (SE :NAME [IS A GOOD NAME])
END
NAMIT1 defined
NAMIT 

PLEASE TYPE A NAME 
KURT 
KURT IS A GOOD NAME 
PLEASE TYPE A NAME 

THAT'S A NUMBER NOT A NAME 

TopIndex