invalid loop - Maple Help

Error, invalid loop

 Description In Maple, for loops and while loops must be terminated with end do (or od). This error occurs when there is no end do or od statement to terminate the loop.

Examples

Example 1

In the following example, the for loop contains only a controlling clause, and does not contain an end do or od statement to terminate the loop.

 >
 

Solution:

Complete the statement and add end do or od to the end of the loop.

 >
 ${1}$
 ${2}$
 ${3}$ (2.1)

Example 2
The following example contains a loop that is intended to return a floating-point approximation to the sine function at the angles (measured in degrees) in the list L. However, pressing Enter to insert line breaks (and not Shift + Enter) after the controlling clause in the for loop generates an error.

 >
 >
 

Solution

To correct this error, press Shift + Enter to insert line breaks within the loop body instead of simply pressing Enter. Terminate the for loop with either an end do or an od statement.

 >
 >
 ${0.3971478907}$
 ${0.9988061374}$
 ${0.6819983600}$
 ${0.9857034691}$ (2.2)