Error, invalid loop
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.
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.
for i from 1 to 3 do
Complete the statement and add end do or od to the end of the loop.
for i from 1 to 3 do printi end do
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.
L ≔ 23.4, 87.2, 43.0, 99.7:
for i in L do
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.
for i in L do evalfsini*Pi/180; end do;
Download Help Document
What kind of issue would you like to report? (Optional)