weird_iris
New member
- Joined
- Oct 24, 2012
- Messages
- 2
- Programming Experience
- Beginner
Hi guys im new to VB.net
and i am stucking in one of my assignment question.
DisplayOutput()
Method Type Sub Procedure
Parameters One String, one Boolean
Description Displays the content of the String in the Statistics Output Label (SOL)
· Appends the String to the existing content of the SOL if Boolean is
TRUE otherwise the existing content is overwritten.
Return Type None
ShowStats()
Method Type Sub Procedure
Parameters None
Description · Calls CountScores(), then displays the return value using
DisplayOutput().
· Calls SumScores(), then displays the return value using
DisplayOutput().
those are the two sub procedures requirement.
i try to do it but the code just can't be overwritten and also the as many times as i press the button the sum function will keep adding but not reset and count the sum again.
for example i have 1,2 in listbox i press once the sum will be 3 then when i press again it should be 3 as well but it shows 6......
pls help.....
here is my code im struggling with it.......
i am really confusing right now......ffended:ffended:
and i am stucking in one of my assignment question.
DisplayOutput()
Method Type Sub Procedure
Parameters One String, one Boolean
Description Displays the content of the String in the Statistics Output Label (SOL)
· Appends the String to the existing content of the SOL if Boolean is
TRUE otherwise the existing content is overwritten.
Return Type None
ShowStats()
Method Type Sub Procedure
Parameters None
Description · Calls CountScores(), then displays the return value using
DisplayOutput().
· Calls SumScores(), then displays the return value using
DisplayOutput().
those are the two sub procedures requirement.
i try to do it but the code just can't be overwritten and also the as many times as i press the button the sum function will keep adding but not reset and count the sum again.
for example i have 1,2 in listbox i press once the sum will be 3 then when i press again it should be 3 as well but it shows 6......
pls help.....
here is my code im struggling with it.......
VB.NET:
[FONT=Verdana]Private Sub DisplayOutput(ByVal Stat As String, ByVal append As Boolean) Dim vCtxt As String[/FONT]
[FONT=Verdana]vSta = Sta_Label.Text & Stat & ControlChars.NewLine[/FONT]
[FONT=Verdana]If append = True Then[/FONT]
[FONT=Verdana]Sta_Label.Text = vSta[/FONT]
[FONT=Verdana]Exit Sub[/FONT]
[FONT=Verdana]Else[/FONT]
[FONT=Verdana]vCtxt = Sta_Label.Text & Stat & ControlChars.NewLine[/FONT]
[FONT=Verdana]Sta_Label.Text = vCtxt[/FONT]
[FONT=Verdana]End If[/FONT]
[FONT=Verdana]Exit Sub[/FONT]
[FONT=Verdana]End Sub[/FONT]
[FONT=Verdana]Private Sub showstats()[/FONT]
[FONT=Verdana]Call CountScores()[/FONT]
[FONT=Verdana]vCountN = vCount[/FONT]
[FONT=Verdana]If vCountN <> vCount Then[/FONT]
[FONT=Verdana]Status = False[/FONT]
[FONT=Verdana]Call DisplayOutput(vCountT, Status)[/FONT]
[FONT=Verdana]Else[/FONT]
[FONT=Verdana]Status = True[/FONT]
[FONT=Verdana]Call DisplayOutput(vCountN, Status)[/FONT]
[FONT=Verdana]End If[/FONT]
[FONT=Verdana]vCountT = "Count Scores: " + Convert.ToString(vCount)[/FONT]
[FONT=Verdana]Call SumScores()[/FONT]
[FONT=Verdana]vCountW = vTotal[/FONT]
[FONT=Verdana]If vCountW <> vTotal Then[/FONT]
[FONT=Verdana]Status = False[/FONT]
[FONT=Verdana]Call DisplayOutput(vCountW, Status)[/FONT]
[FONT=Verdana]Else[/FONT]
[FONT=Verdana]Status = True[/FONT]
[FONT=Verdana]Call DisplayOutput(vCountS, Status)[/FONT]
[FONT=Verdana]End If[/FONT]
[FONT=Verdana]vCountS = "Sum Scores: " + Convert.ToString(vTotal)[/FONT]
[FONT=Verdana]End Sub[/FONT]