davidciccarello@[EMAIL PROTECTED]
writes:
>numberp :v iffalse [messagebox [error] [you need to use number(s) are
>your first digits]]
Logo procedures are divided into COMMANDS (which /do/ something) and
OPERATIONS (which compute a value for use by other procedures). A Logo
instruction has to start with a command. So this line, which starts with
the operation NUMBERP, is already wrong before looking at anything else.
As other people have said, either you want
TEST NUMBERP :V
IFFALSE [...]
or you want the more compact
IF NOT NUMBERP :V [,,,]
TEST and IF are commands. IF decides to take or not take an action (in
your
case the MESSAGEBOX instruction) based on a true/false test. TEST just
remembers the result of a true/false test for use by a later IFTRUE and/or
IFFALSE.
>numberp 1>:v>13 iftrue [messagebox [error] [your first 2 inputs must
>be numbers between 1 and 13]]
As several people have remarked, Logo (like most programming languages,
I think) doesn't do what you mean with ...<...<... (I'm assuming you meant
lessthan, not greaterthan, since 1>13 would always be false!)
Also as has been remarked, the result from < would in any case always be
TRUE or FALSE, neither of which is a number, so the NUMBERP would return
FALSE. Just leave out the NUMBERP.
"P" at the end of a procedure name means (by convention) "Predicate,"
i.e., an OPERATION that always returns a TRUE or FALSE value. So it's
asking the question "is such-and-such a number?" You've already asked
that question in the previous line; you don't have to ask it again.


|