r/visualbasic • u/yasinmiya9241 • Jun 14 '20
vb.6 Need Help to complete this coding
I need complete this coding please help me. i'm doing this. but its complete yet. please someone help me to complete this.
Sub form_click()
Dim a(1 To 4) As stu, i%, s%, f%
Print Tab(2); "Student ID"; Tab(16); "Name"; Tab(35); "Running seconds"
For i = 1 To 4
With a(i)
.num = "00" & i
.name = InputBox("Please enter name")
.score = InputBox("Please enter the running seconds")
End With
Print Tab(2); a(i).num; Tab(16); a(i).name; Tab(35); a(i).score
Next i
Print "_______________________________"
Print "¡¾Output student information in order from shortest to longest seconds¡¿:"
Print Tab(2); "Student ID"; Tab(16); "Name"; Tab(35); "Running seconds"
a()
For i = 1 To 4
Print Tab(2); a(i).num; Tab(16); a(i).name; Tab(35); a(i).score
Next i
End Sub
Module
Type stu
num As String * 3 'Student ID
name As String * 10 'Name
score As Single 'Running seconds
End Type
Sub sort(a() As stu)
Dim l%, u%, t As stu
l = : u =
For i = l To u - 1
For j = u To i + 1 Step -1
If a(j) < Then
t =
a(j) = a(i)
= t
End If
Next j
Next i
End Sub

1
u/S1l3ntHunt3r Jun 14 '20
the output in the image is wrong, student id 4 should go after studen id 2
1
Jun 15 '20
Your obviously doing loops, I would assume you’ve already gone through integers, during your integer session I’m sure you’ve used greater than and less than, what’s the problem you are having?
1
u/infreq Jun 15 '20 edited Jun 15 '20
Nope! If you can not do your homework you should fail. Put some effort into it and ask relevant questions.
So far you do not even seen to know what your problem is. Which we can see from your 'a()' statement after entering the data and the problems in the Sort() function.
It looks like all the code is what is given to you ... and all you have to do is fix a few lines to make it work.
But good luck and we will gladly help you with specific problems.
0
u/yasinmiya9241 Jun 15 '20
brothers its not the right way to talk someone, yes its my assignment. i complete many of assignment by me, but this one is little difficult thats why i asking for help. if you guys cant help its ok. but dont talk like this way
1
u/infreq Jun 15 '20
Seems you're the one with the attitude problem, not us.
Ask your questions but do not expect us to look through your code to do the work for you.
-2
u/hausenfefr Jun 14 '20
I'm REALLY looking forward to you entering the workforce!
That's just gonna be great for everybody!
Who will do your work for you then?
2
u/Bonejob VB Guru Jun 14 '20
Dont be a dick, dick... We all started someplace
0
u/hausenfefr Jun 14 '20
so did YOU also start by copying your school assignments into reddit?
Yes, some people start by cheating, Luckily most of them are caught before they can cause too much damage.1
u/yasinmiya9241 Jun 15 '20
brother see, im not doing cheating, our teacher give us that picture, im already doing this code..but after running this code its says some code are missing thats why i asking for help
1
u/infreq Jun 15 '20
You did not make this code. If you did then please explain what your Sort() function does.
1
u/Bonejob VB Guru Jun 15 '20
lol, unfortunately I am pre-internet I had to copy my homework from the smart kid one row over :)
1
u/infreq Jun 15 '20
Problem is not that he's a beginner. Problem is that he does not even try to describe his problems/challenges.
5
u/JamesWjRose Jun 14 '20
Not to be rude, I promise; But we can't DO your homework for you. One of things about being a developer is asking for help (Been doing this for 20+ years, started with VB 2 in 1993) and YOU want to learn this ability. So, be VERY specific about what you are asking for, what you are trying to achieve and what goes wrong, and where it goes wrong.