In the following program, the GetGroupName method is used to display the group names in a two-group analysis.
Imports System.Diagnostics
Module MainModule
' GetGroupName Method Example
Sub Main()
Dim Sem As New AmosEngineLib.AmosEngine
Sem.TextOutput()
Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\Fels_fem.sav")
Sem.GroupName("girls")
Sem.AStructure("academic = GPA + attract + error1 (1)")
Sem.AStructure("attract = height + weight + rating + academic + error2 (1)")
Sem.AStructure("error2 <--> error1")
Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\Fels_mal.sav")
Sem.GroupName("boys")
Sem.AStructure("academic = GPA + attract + error1 (1)")
Sem.AStructure("attract = height + weight + rating + academic + error2 (1)")
Sem.AStructure("error2 <--> error1")
Dim i As Integer
For i = 1 To Sem.NumberOfGroups
Debug.WriteLine("Group " & i & " is called " & Sem.GetGroupName(i))
Next
Sem.Dispose()
End Sub
End Module