|
-
Mar 9th, 2000, 02:23 PM
#1
Thread Starter
Lively Member
I am having trouble with getting the proper results from an equation. I have simplified the equation for this example. The numbers on the left increment properly, but the results are wierd. The numbers on the right should two times the number on the left. ( in each column )
Option Explicit
'This code assumes a text box called Text1 set to multiline
'true and a command button named Command1
Private Sub Command1_Click()
Dim ResultsArray() As Single 'Or whatever
Dim g As Single
Dim r As Single
Dim l As Single
Dim h As Single
Dim v As Single
Dim TempStr As String
r = 20
ReDim ResultsArray(1 To 2 * r)
l = 72
For h = 1 To (2 * r) - 1 Step 0.5
v = h * 2
ResultsArray(h) = v
Next h
TempStr = ""
For h = 1 To r Step 0.5
TempStr = TempStr & h & Chr(9) & ResultsArray(h) & _
Chr(9) & Chr(9) & Chr(9) & _
h + r & Chr(9) & ResultsArray(h + r) & vbCrLf
Next h
Text1.Text = TempStr
End Sub
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
|