This example determines how many sessions are open (with the aid of the Count property), and then lists them (with the aid of the Item method).
Sub Main()
Dim Sessions As New ExtraSessions
Dim Sess As ExtraSession
' This example opens one session using the open method
to:
' 1) get the number of sessions (with the aid of the Count
' property),
' 2) list them (with the aid of the Item method).
SessionCount = Sessions.Count
Set Sess = Sessions.Open("Tn3270.edp")
Sess.Visible= TRUE
For i = 1 to SessionCount
SessNames$ = SessNames$ +.Sessions.Item(i).Name + " "
Next
MsgBox "The number of sessions = " + SessionCount + ".They are: " + SessNames$
End Sub