sorting help?

I am taking a visual basic class on the side, I work for a New York State Hospital, but want to eventually get a degree in computer science. My professor just assigned us an assignment, and I have completed it, but it is all wrong, I have no idea what I did wrong. If someone could help me, I would definitely appreciate it, the professor does not provide office hours so i cannot find anyone who can help me with this.

basically he wants us to sort the four words and get the strings into the variable. I am mainly having trouble with sorting. I think I have everything else correct, we had to make everything invisible instead of start and end...then as the user types in each text box the next box becomes visible...i think i got that right. again, its just the sorting i am having trouble with. Can someone show me an easy sorting method, i want to sort it by LENGTH also known as "LEN"...can you help? thank u so much. i have to sort all four variables.

here is what i have:

'global vars
Dim G As String
Dim H As String
Dim I As String
Dim J As String
Dim First As String
Dim Second As String
Dim Third As String
Dim Last As String
Private Sub cmdExit_Click()
Unload Me
End Sub

Private Sub cmdSort_Click()
G = t1
H = t2
I = t3
J = t4
l1.Visible = False
t2.Visible = False
End Sub

Private Sub cmdStart_Click()
'make visible the text box
t1.Visible = True
l1.Visible = True
End Sub

Private Sub Form_Load()
Print "This program will do something really great."
Print "Click the start button to begin or the exit to quit."
End Sub

Private Sub t1_Change()
t2.Visible = True
l2.Visible = True
End Sub

Private Sub t2_Change()
t3.Visible = True
l3.Visible = True
End Sub

Private Sub t3_Change()
t4.Visible = True
l4.Visible = True
End Sub

Private Sub t4_Change()
cmdSort.Visible = True
End Sub
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!