PC Logo Wiki
Advertisement

Syntax

DEFINED? name

Explanation

DEFINED? outputs TRUE if the input is a name of a primitive procedure or a user-defined procedure; otherwise; it outputs FALSE.

Examples

? DEFINED? "FORWARD

Result: TRUE

? DEFINED? "BLIMP

Result: FALSE

? TO MYPROC

> PRINT [THIS IS MY PROCEDURE.]

> END

MYPROC defined

? IF DEFINED? "MYPROC THEN MYPROC

THIS IS MY PROCEDURE.

?

Advertisement