Top Property Example

This example uses Top and Bottom properties with an Area object to narrow a selection on the screen. Then the example uses the Top property with a Session object to move the session around on the screen.

Sub Main()

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

 

 Set Sys = CreateObject("EXTRA.System")

 ' Assumes an open session

 Set Sess = Sys.ActiveSession

 Set MyScreen = Sess.Screen

 

 ' This illustrates the Top and Bottom properties for an Area
 ' object. For demonstration purposes, the Select method is used,
 ' but it is not required for setting Top and Bottom properties.

 MsgBox "Press to demonstrate the Top and Bottom properties for Area objects."

 Set MyArea = MyScreen.Area(1, 1, MyScreen.Rows, MyScreen.Cols,,3)

 MyArea.Select

 For i = 1 to Int(MyScreen.Rows/2)

  MyArea.Top = MyArea.Top + 1

  MyArea.Select

  MyArea.Bottom = MyArea.Bottom - 1

  MyArea.Select

 Next

 

 ' This demonstrates the Top property for a Session object.

 MsgBox "Press to demonstrate the Top property for Session objects."

 Sess.Top = 50

 MsgBox "The session top is now at 50. Press to move session top to 1"

 Sess.Top = 1

 MsgBox "The session top is now at 1. Press to move session top to 100"

 Sess.Top = 100

End Sub