By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,234 Members | 1,869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,234 IT Pros & Developers. It's quick & easy.

Arrays

P: 3
OK. I give up. I am trying to use my VB6 logic in VBNET and failing miserably. I wrote the following and expected to get a variable into FUL(), AAB(), and PWX()
What did I do wrong?

Expand|Select|Wrap|Line Numbers
  1. Dim FUL() As String, AAB() As String, PWX() As String
  2. Dim FILE1 As String = "C:\PERSONS\NAMES"
  3.  
  4. LNAME = InputBox("Type your LAST NAME then push <Enter>", "TYPE YOUR LAST NAME", "Last Name")
  5.  
  6. Dim objReader As New System.IO.StreamReader(FILE1)  ' FIND STUDENT IN NAMES
  7.         For I = 1 To CTR
  8.             BA = objReader.ReadLine
  9.             FLL = objReader.ReadLine
  10.             AB = objReader.ReadLine
  11.             PW = objReader.ReadLine
  12.             BA = UCase(BA)
  13.             TEST = BA.Substring(0, Len(LNAME))
  14.             If TEST = FNAME Then
  15.                 ReDim Preserve FUL(1), AAB(1), PWX(1)
  16.                 FUL(NCTR) = FLL : AAB(NCTR) = AB : PWX(NCTR) = PW
  17.                 NCTR = NCTR + 1  ' NCTR = # STUDENTS MATCHING TYPED NAME
  18.             End If
  19.         Next
  20.  
  21.  
Jun 27 '13 #1
Share this Question
Share on Google+
1 Reply


Expert 5K+
P: 8,434
What were the values of CTR, NCTR and FNAME when all this started?

(Warning: I'm a VB6 programmer too, and don't know VB.Net yet)
Jul 18 '13 #2

Post your reply

Sign in to post your reply or Sign up for a free account.