MoveRelative Method Example

This example moves the cursor to twenty-five random positions.

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

 

 ' This causes the cursor to run all over the screen

 For i = 1 To 25

  Randomize

  dX = Int(Rnd() * 10) - 5

  dY = Int(Rnd() * 10) - 5

  MyScreen.MoveRelative dX, dY

 Next

End Sub