Name Property Example

This example demonstrates the use of the Name property with System, Session, QuickPad, and Toolbar objects.

Sub Main()

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

 

 ' This gets the System object

 Set Sys = CreateObject("EXTRA.System")

 

 ' Assumes an open session

 Set Sess = Sys.ActiveSession

 Set MyScreen = Sess.Screen

 

 ' This is an example of how to use the Name property for the

 ' System object.

 SysName$ = Sys.Name

 MsgBox "The Sys Name is " + SysName$ + "."

 

 ' This is an example of how to use the Name property for the

 ' Screen object.

 ScreenName$ = MyScreen.Name

 MsgBox "The Screen Name is " + ScreenName$ + "."

 

 ' This is an example of how to use the Name property for a

 ' Session object.

 SessionName$ = Sys.ActiveSession.Name

 MsgBox "The Session Name is " + SessionName$ + "."

 

 ' This is an example of how to use the Name property for a

 ' QuickPad object. This also shows how the QuickPads object

 ' (a collection object) might be used.

 

 For i = 1 to Sess.Quickpads.Count

  If Sess.QuickPads.Item(i).Visible then

   rc% = MsgBox( "The QuickPad " + Sess.QuickPads.Item(i).Name _
   + " is visible.", 1 )

  else

   rc% = MsgBox( "The QuickPad " + Sess.QuickPads.Item(i).Name _
   + " is NOT visible.", 1 )

  end if

  if rc% = 2 then

   Exit For

  end if

 Next

 

 ' This is an example of how to use the Name property for

 ' a Toolbar object. This also shows how the Toolbars object

 ' (a collection object) might be used.

 For i = 1 to Sess.Toolbars.Count

  If Sess.ToolBars.Item(i).Visible then

   rc% = MsgBox( "The Toolbar " + Sess.ToolBars.Item(i).Name _
   + " is visible.", 1 )

  else

   rc% = MsgBox( "The Toolbar " + Sess.ToolBars.Item(i).Name _
   + " is NOT visible.", 1 )

  end if

   if rc% = 2 then

    Exit For

   end if

 Next

 

 MsgBox "Done."

End Sub