Notices
The Basement Non-Honda/Acura discussion. Content should be tasteful and "primetime" safe.

VB.Net help needed

Thread Tools
 
Old Mar 25, 2004 | 06:22 PM
  #1  
ManInCamo's Avatar
ManInCamo
Thread Starter
Old School Crew
 
Joined: May 2000
Posts: 5,251
Likes: 0
Default VB.Net help needed

i need to fix this nested IF statement.... WTF?

i have to use the if statement like this btw
Attached Files
File Type: txt
code.txt (5.3 KB, 7 views)
Reply
Old Mar 25, 2004 | 06:49 PM
  #2  
KidA's Avatar
KidA
Registered User
 
Joined: Jun 2003
Posts: 84
Likes: 0
From: Atlantic City, NJ
Default

Originally Posted by ManInCamo
i need to fix this nested IF statement.... WTF?

i have to use the if statement like this btw
I haven't done VB in a while but I'm guessing you should either a. move the EndIfs up

ex:

If Branch = "A" Then
branchout = "Army"
USA = USA + 1
If Rank = "P" Then
rankout = "Private"
ElseIf Rank = "L" Then
rankout = "Lieutenant"
Lt = Lt + 1
Else
rankout = "INVALID"
sw.WriteLine("Error in Rank Code")
errmsg = "Error in Record"
[possibliy EndIf here]
If Branch = "N" Then
branchout = "Navy"
USN = USN + 1
.....

or b. you just need to add the ElseIfs to when you're checking for the Branch.

ex:
If Branch = "A" Then
branchout = "Army"
USA = USA + 1
If Rank = "P" Then
rankout = "Private"
ElseIf Rank = "L" Then
rankout = "Lieutenant"
Lt = Lt + 1
Else
rankout = "INVALID"
sw.WriteLine("Error in Rank Code")
errmsg = "Error in Record"
[ElseIf] Branch = "N" Then
branchout = "Navy"
USN = USN + 1
.....

Hope this helps. if not my bad
Reply
Old Mar 25, 2004 | 07:00 PM
  #3  
ManInCamo's Avatar
ManInCamo
Thread Starter
Old School Crew
 
Joined: May 2000
Posts: 5,251
Likes: 0
Default

ok, fixed the if statements , it needed to look like this:
ElseIf Branch = "F" Then
branchout = "AirForce"
USAF = USAF + 1
If Rank = "A" Then
rankout = "Airman"
ElseIf Rank = "M" Then
rankout = "Major"
Maj = Maj + 1
Else
rankout = "INVALID"
sw.WriteLine("Error in Rank Code")
errmsg = "Error in Record"
End If
ElseIf Branch = "M" Then
branchout = "Marines"
USMC = USMC + 1
If Rank = "G" Then
rankout = "General"
Gen = Gen + 1
ElseIf Rank = "C" Then
rankout = "Colonel"
Col = Col + 1
Else
rankout = "INVALID"
sw.WriteLine("Error in Rank Code")
errmsg = "Error in Record"
End If
End If



-------------------




now,however, my problemis that the first list box, lst1, is only displaying ONE of the personel files, i need ALL listed
Attached Images
File Type: jpg
form1.jpg (53.2 KB, 4 views)
Reply
Old Mar 25, 2004 | 07:34 PM
  #4  
ManInCamo's Avatar
ManInCamo
Thread Starter
Old School Crew
 
Joined: May 2000
Posts: 5,251
Likes: 0
Default

i fixed it all, thanks anywho
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Shaggs2Dope
Engine Swaps, Tech & Tuning
5
May 5, 2003 10:05 PM
undrgrndhaqer
Engine Swaps, Tech & Tuning
5
Feb 2, 2003 11:07 AM
tokyoracer
92+ Civic/EL & Del Sol
6
Jul 31, 2002 07:44 PM




All times are GMT -8. The time now is 01:57 PM.