MoveTo Method Example

The example moves the cursor to a random row, column and page on the screen.

Sub Main()

 Dim Sys As Object, Sess As Object, MyScreen As Object

 

 Set Sys = CreateObject("EXTRA.System")

' Assumes an open session

 Set Sess = Sys.ActiveSession

 Set MyScreen = Sess.Screen

 

 For i = 1 to 10

  Randomize

  NewRow = Int(MyScreen.Rows*Rnd())+1

  NewCol = Int(MyScreen.Cols*Rnd())+1

    NewPage = Int(MyScreen.Pages*Rnd())+1

  MsgBox "Move to " + Str$(NewRow) + "," + Str$(NewCol) + "."

  MyScreen.MoveTo NewRow,NewCol,NewPage

 Next

End Sub