Next: On-Line Help Up: Maple: An Introduction Previous: Arithmetic and Maple

Mistakes and Errors

If you forget the semicolon don't panic! Maple will simply print another prompt indicating that it is still waiting for more input. Just type the semicolon and return and Maple will go ahead and compute the result. Note, this means that you can enter large expressions over one or more lines. Try to input a large expression like the following


> f := 4*x^4+3*x^3*y+2*x^2*y^2+
>      3*x*y^3+4*y^4;

                          4      3        2  2        3      4
                  f := 4 x  + 3 x  y + 2 x  y  + 3 x y  + 4 y

If you incorrectly input an expression, Maple will respond with a syntax error. A common error is to forget the semicolon and then to try to correct the problem by retyping the input. For example, one user typed


> 2*x+1 
> 2*x+1

and Maple replied


syntax error:
2*x+1
^

The user forgot the semicolon after typing 2*x+1 and return. The user then typed in another 2*x+1. Maple now says that there is an error and points to where it thinks the error is with the ^ character. What the user typed is equivalent to typing


> 2*x+1 2*x+1

Now you can see why Maple thinks the expression is wrong. To recover from a syntax error, just type a semicolon to clear the remaining input, and then reenter the command.


bondaren@thsun1.jinr.ru