|
-
Oct 29th, 2010, 04:14 PM
#1
Thread Starter
New Member
Anoying Zero Impossible to resolve, can you?
Thank you all for your help:
My program is running great with one little problem, it keep adding a zero to my listbox and the multiplication and sum result don't line up well. Heeeeelp. the result would be like:
1X0 = 0 <==== The Problem
1X1 = 0
1X2 = 1
1X3 = 2
please post the code is my first vb project and my head hurt trying to resolve this problem.
===============new code===============================
Dim numeroMulti, numeroSuma As Integer
'data enter by user
numeroMulti = CDbl(TextBox1.Text)
numeroSuma = CDbl(TextBox1.Text)
'line of code to call modul tmultiSuma
Call tmultiSuma(numeroMulti, numeroSuma)
End Sub
Public Sub tmultiSuma(ByVal numeroMulti As Integer, ByVal numeroSuma As Integer)
Dim tMulti, tSuma, tCounter As Integer
'loop to calculat sum and multiplication table
Do Until tCounter = 13
'lista resultado multiplicacion
ListBox1.Items.Add(tCounter & "X" & numeroMulti & "=" & "" & tMulti)
'lista resultado suma
ListBox2.Items.Add(tCounter & "+" & numeroSuma & "=" & "" & tSuma)
'operation with a counter
tMulti = tCounter * numeroMulti
tSuma = tCounter + numeroSuma
tCounter = tCounter + 1
Loop
Last edited by thewhiteshadow; Oct 29th, 2010 at 05:09 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|