Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am doing a Select Case where I am trying to keep track of the members who have joined club the members go by Bronze, Silver, and Gold I am trying to read them out of the newmembs.txt in order, all bronze the all silver then of coures all gold heres what I got but I am having trouble with what I got, can you look at what I got, Thanks Steve T

 

Dim vmembers As String

Dim bronze As Integer

Dim silver As Integer

Dim gold As Integer

FileOpen(1, "newmembs.txt", OpenMode.Input)

Do Until EOF(1)

Input(1, vmembers)

Select Case vmembers

Case "bronze"

bronze = 1 + bronze

Case "silver"

silver = 1 + silver

Case "gold"

gold = 1 + gold

Case Else

End Select

Loop

lstout.Items.Add(bronze & silver & gold)

End Sub

End Class

Posted

don't worry all I figured it out

 

Dim vmembers As String

Dim vbronze(1) As String

Dim vsilver(1) As String

Dim vgold(1) As String

Dim vtype As String

Dim bronze As Integer = 1

Dim silver As Integer = 1

Dim gold As Integer = 1

Dim I As Integer

Dim cnt As Integer

FileOpen(1, "newmembs.txt", OpenMode.Input)

Do Until EOF(1)

Input(1, vmembers)

Input(1, vtype)

Select Case vtype

Case "Bronze"

vbronze(bronze) = vmembers

bronze = 1 + bronze

ReDim Preserve vbronze(bronze)

Case "Silver"

vsilver(silver) = vmembers

silver = 1 + silver

ReDim Preserve vsilver(silver)

Case "Gold"

vgold(gold) = vmembers

gold = 1 + gold

ReDim Preserve vgold(gold)

Case Else

End Select

cnt = cnt + 1

Loop

For I = 0 To bronze - 1

 

lstout.Items.Add(" " & vbronze(I))

Next

For I = 0 To silver - 1

lstout.Items.Add(" " & vsilver(I))

Next

For I = 0 To gold - 1

lstout.Items.Add(" " & vgold(I))

Next

FileClose(1)

 

End Sub

End Class

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...