bobmack37 Posted May 27, 2003 Posted May 27, 2003 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 Quote
Administrators PlausiblyDamp Posted May 28, 2003 Administrators Posted May 28, 2003 Where you have Select Case vmembers try Select vmembers Also you really should look at System.IO for doing file handling, it's far superior to the VB6 way of doing things Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
*Experts* mutant Posted May 28, 2003 *Experts* Posted May 28, 2003 Are you getting any particular errors or just nothing happens? Quote
bobmack37 Posted May 28, 2003 Author Posted May 28, 2003 Are you getting any particular errors or just nothing happens? I am just getting 000 in the lstout box. Quote
Administrators PlausiblyDamp Posted May 28, 2003 Administrators Posted May 28, 2003 If you set a break point on the Select Line, what values are you getting for the vmembers variable? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
*Experts* mutant Posted May 28, 2003 *Experts* Posted May 28, 2003 That code works fine for me. Are you sure your file has strings that you are looking for? Quote
bobmack37 Posted May 29, 2003 Author Posted May 29, 2003 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.