[MWForum]Syntax not working

Wendy Petti mwforum@lists.mathcats.com
Sun, 22 Feb 2004 13:32:27 -0500


Oops!  Susan is certainly right; you cannot use SHAPE as a procedure name.
Also, to clarify:  you do indeed use TO when you are naming a procedure.
But you don't use TO when you are calling the procedure (when you are
activating it).  So here is what you might use:

[on the procedures page]

to polygon :value
repeat :value [fd 100 rt 360 / :value]
end

[and then, in the command center]

polygon 6

[OR on the project page, for a button name]

polygon 6

By the way, if you would like the user to be able to control the number of
sides, you could use a slider named (for instance) #SIDES and then revise
your procedure like this:

TO POLYGON
REPEAT #SIDES [FD 100 RT 360 / #SIDES]
END

Note that in this case, when you are using a slider for the input to a
variable, you do not need to create a variable in the procedure name and you
do not use a colon before the name of the slider.  In the command center or
in a button name you would simply have the word POLYGON, and the procedure
would use the selected value on the #SIDES slider.

Wendy