home *** CD-ROM | disk | FTP | other *** search
/ Master 95 #1 / MASTER95_1.iso / microsof / vbasic4 / vb4-6.cab / initial.bas < prev    next >
Encoding:
BASIC Source File  |  1995-07-26  |  2.3 KB  |  71 lines

  1. Attribute VB_Name = "Module2"
  2. ' Fill the list of player positions.
  3. Sub fillPoitionsList()
  4. Dim position
  5.     ' Ask the object application (SOCCER.MAK) for all the position names.
  6.     For Each position In gServerApp.positions
  7.         Form1.listPlayerPosition.AddItem position
  8.     Next
  9. End Sub
  10.  
  11. ' Fill the list of teams in the list box with
  12. ' all the teams listed in SOCCER.MAK.
  13. Sub fillTeamsList()
  14. Dim team_name$
  15. Dim loop1%
  16.  
  17.     ' List the total number of teams in the Number of Teams caption.
  18.     Form1.labelNumberTeams.Caption = Trim(Str(gServerApp.Teams.Count - 1))
  19.  
  20.     ' Clear the list boxes.
  21.     Form1.listTeams.Clear
  22.     Form1.listPlayerTeam.Clear
  23.  
  24.     ' Note there are two lists to fill:
  25.     ' 1. The list of teams for the graphical soccer field display.
  26.     ' 2. The list of players in the individual player information section.
  27.     For loop1% = 1 To gServerApp.Teams.Count
  28.         ' Get the team name from the Teams collection.
  29.         team_name$ = gServerApp.Teams.Item(loop1%).Name
  30.         Form1.listTeams.AddItem team_name$
  31.         Form1.listPlayerTeam.AddItem team_name$
  32.     Next
  33.    
  34. End Sub
  35.  
  36. ' Fill listPlayerName list box with
  37. ' all the teams listed in SOCCER.MAK.
  38. Sub fillPlayersList()
  39. Dim player_name$
  40. Dim loop1%
  41.  
  42.     ' Get the number of players and display it in the Total # of Players caption.
  43.     Form1.labelNumberPlayers.Caption = Trim(Str(gServerApp.Players.Count))
  44.  
  45.     'Clear the list boxes.
  46.     Form1.listPlayerName.Clear
  47.     
  48.     For loop1% = 1 To gServerApp.Players.Count
  49.         ' Get the team name from the collection.
  50.         player_name$ = gServerApp.Players.Item(loop1%).Name
  51.         Form1.listPlayerName.AddItem player_name$
  52.     Next
  53.    
  54. End Sub
  55.  
  56. ' Resets the names of all the positions on the form.
  57. Sub ResetPositionNames()
  58.     Form1.LabelStriker.Caption = "Striker"
  59.     Form1.LabelCenter.Caption = "Center"
  60.     Form1.labelRightForward.Caption = "Right Forward"
  61.     Form1.LabelLeftForward.Caption = "Left Forward"
  62.     Form1.LabelLeftWing.Caption = "Left Wing"
  63.     Form1.LabelCenterMidfielder.Caption = "Center Midfielder"
  64.     Form1.labelRightWing.Caption = "Right Wing"
  65.     Form1.LabelLeftFullback.Caption = "Left Fullback"
  66.     Form1.LabelSweeper.Caption = "Sweeper"
  67.     Form1.LabelRightFullback.Caption = "Right Fullback"
  68.     Form1.LabelGoalie.Caption = "Goalie"
  69. End Sub
  70.  
  71.