Result - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Connectivity : Database Package : Result : Database/Result/GotoRow

Result

  

GotoRow

  

move the cursor to the given row

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

result:-GotoRow(offset, opts )

Parameters

result

-

Result module

offset

-

integer; the index of the row

opts

-

(optional) equation of the form relative=boolean

Description

• 

GotoRow moves the row cursor maintained within result to the row indexed by offset.  If offset is positive, then it is interpreted to be relative to the beginning of the table.  GotoRow(1) is the first row, GotoRow(2) is the second, and so forth.  If offset is negative, then it is interpreted to be relative to the last row of the table.  GotoRow(-1) is the last row, GotoRow(-2) is the second to last row.

• 

The index of the current row can be obtained by calling GetRowIndex.

• 

GotoRow accepts one optional argument.

  

relative = boolean

  

If relative is true, then offset is interpreted as relative to the current row.  For example, GotoRow(1,relative=true) is equivalent to Next.

• 

Setting the row cursor to a location beyond the ends of the table results in the cursor getting set to the row before the first data row or the row after the last data row.

Examples

Create a Result.

driverDatabase[LoadDriver]:

conndriver:-OpenConnectionurl,name,pass:resconn:-ExecuteQuerySELECT name FROM animals:

Notice the order of names.

res:-ToMapleoutput='Array'

fishdogcatrathorsesnakelizardparrotpighamster

(1)

Go to the last row.

res:-GotoRow1

true

(2)

res:-GetData1

hamster

(3)

Go to the first row.

res:-GotoRow1

true

(4)

res:-GetData1

fish

(5)

Go to the second row.

res:-GotoRow1,relative=true

true

(6)

res:-GetData1

dog

(7)

Go to the second to last row.

res:-GotoRow2

true

(8)

res:-GetData1

pig

(9)

Go to the third to last row (absolute index of 8).

res:-GotoRow1,relative=true

true

(10)

res:-GetData1

parrot

(11)

Go to the fourth row (8-4=4).

res:-GotoRow4,relative=true

true

(12)

res:-GetData1

rat

(13)

Go to the sixth row (4+2=6).

res:-GotoRow2,relative=true

true

(14)

res:-GetData1

snake

(15)

res:-GotoRow10,relative=true

false

(16)

res:-GotoRow20

false

(17)

See Also

Database

Database[Result]

Database[Result][First]

Database[Result][GetRowIndex]

Database[Result][Last]

Database[Result][Previous]

Database[usage]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam