need help with VB code (in Off-topic)


Pwned February 7 2010 7:01 PM EST


I'm not getting exponents correctly, what am I doing
wrong?



Private Sub Calculations(ByVal Base As Decimal, ByVal Exponents As
Decimal, ByVal NumberOfCalculations As Decimal)
'a counter for my loop
Dim intCounter As Integer
'setting starting positions for the results
Dim intX As Integer = 100
Dim intY As Integer = 40
Dim pntStart As New Point(intX, intY)
'divides number of calculations in half to set a new start
on the panel
Dim intMiddle As Integer = (NumberOfCalculations / 2)
Dim dcmResults As Decimal

Do Until intCounter = NumberOfCalculations
intCounter += 1
For index As Integer = 1 To Exponents + intCounter - 1
dcmResults += Base * Base
Next
pnlResults.Controls.Add(New Label With {.Name = "lblNum" &
intCounter, .Text = dcmResults, .Location = pntStart,
.AutoSize = True})
pntStart.Y += 50
'resets results
dcmResults = 0
If intCounter >= intMiddle Then
pntStart.X += 110
pntStart.Y = intY
End If
Loop
End Sub

Pwned February 7 2010 9:54 PM EST

:( anyone?
This thread is closed to new posts. However, you are welcome to reference it from a new thread; link this with the html <a href="/bboard/q-and-a-fetch-msg.tcl?msg_id=002zew">need help with VB code</a>