Application Property Example

This example shows how the System object can be returned from any object.

Sub Main()

 Dim Sys As Object, AllSess As Object, Sess As Object

 Dim MyQPad As Object

 Dim MyScreen As Object, MyArea As Object

 Dim TBars As Object, QPads As Object, MyTBar As Object, MyQPads As Object

 

 Set Sys = CreateObject("EXTRA.System")

 Set AllSess = Sys.Sessions

' Assumes an open session

 Set Sess = Sys.ActiveSession

 

 Set MyScreen = Sess.Screen

 Set MyArea = MyScreen.Area(1, 1, 10, 10)

 Set TBars = Sess.Toolbars

 Set QPads = Sess.QuickPads

 Set MyTBar = TBars(1)

 Set MyQPad = QPads(1)

 

 ' All these return the same result.

 MsgBox "System.Application = " + Sys.Application.Name

 MsgBox "Sessions.Application = " + AllSess.Application.Name

 MsgBox "Session.Application = " + Sess.Application

 MsgBox "Screen.Application = " + MyScreen.Application.Name

 MsgBox "Area.Application = " + MyArea.Application.Name

 MsgBox "Toolbars.Application = " + TBars.Application.Name

 MsgBox "QuickPads.Application = " + QPads.Application.Name

 MsgBox "ToolBar.Application = " + MyTBar.Application.Name

 MsgBox "QuickPad.Application = " + MyQPad.Application.Name

End Sub