954,136 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

find the error please...

i have a code of a projectile but...
can these code be shorten or not???
i need new version of this and some times if i played this one some error was done
hope you could help me to fing the error


Option Explicit
Dim Angle, Theta, y, x, t, Vo As Single
Const pi = 3.141592654

Private Sub cmdClear_Click()
txtSpeed.Text = ""
txtAngle.Text = ""
End Sub

Private Sub cmdGo_Click()
giatayngatimer.Enabled = True
Vo = Val(txtSpeed.Text)
Theta = pi * Val(txtAngle.Text) / 180
t = 0

End Sub

Private Sub cmdStop_Click()
giatayngatimer.Enabled = False
End Sub

Private Sub Form_Load()
giatayngatimer.Enabled = False
Scale (-45, 1000)-(1000, -1000)
Line (1000, -45)-(-1000, 1000), , BF
End Sub

Private Sub giatayngatimer_Timer()
y = Vo * Sin(Theta) * t - (4.9) * (t ^ 2)
x = Vo * Cos(Theta) * t
t = t + 1
shapeCircle.Top = Fix(y)
shapeCircle.Left = Fix(x)
End Sub

thanx a lot!!! god bless you!!!! and more powers!!!

WhitePunk
Newbie Poster
11 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
 

u mean,it has to b written in vb.net or entire procedure to be reduced!!!

preetham.saroja
Junior Poster in Training
82 posts since Jun 2007
Reputation Points: 5
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You