Last - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Result

 Last
 move the cursor to the last row

 Calling Sequence result:-Last( opts )

Parameters

 result - Result module opts - (optional) equation of the form after=boolean

Description

 • Last moves the row cursor maintained within result to the last row of the table.
 • Last accepts one optional argument.
 after = boolean
 If after is true, then the row cursor is moved to the row after the last row containing data, that is, the same location as when a Result module is created.
 • Last returns true if the new row indicated by the cursor is a row containing data.  When called with after=true, Last always returns false.

Examples

Create a Result.

 > $\mathrm{driver}≔\mathrm{Database}\left[\mathrm{LoadDriver}\right]\left(\right):$
 > $\mathrm{conn}≔\mathrm{driver}:-\mathrm{OpenConnection}\left(\mathrm{url},\mathrm{name},\mathrm{pass}\right):$$\mathrm{res}≔\mathrm{conn}:-\mathrm{ExecuteQuery}\left("SELECT name FROM animals"\right):$

Call Last.

 > $\mathrm{res}:-\mathrm{Last}\left(\right)$
 ${\mathrm{true}}$ (1)

Last returned true so it is valid to read data from this row.

 > $\mathrm{res}:-\mathrm{GetData}\left(1\right)$
 ${"hamster"}$ (2)
 > $\mathrm{res}:-\mathrm{Last}\left(\mathrm{after}=\mathrm{true}\right)$
 ${\mathrm{false}}$ (3)
 > $\mathrm{res}:-\mathrm{Previous}\left(\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{res}:-\mathrm{GetData}\left(1\right)$
 ${"hamster"}$ (5)