|
-
Mar 13th, 2005, 12:41 PM
#1
Thread Starter
New Member
Compute Volume of Cylinder - Simple Program
Hi everyone, private newbie reporting for duty. Below is the code I speak of. When I go to run the Build, it complains I have not declared the variables radius, hght and volume. I know it must go into this same section of code and not with the text boxes that the user would inut from. But I dont think it would be a DIM (I could be wrong), I'm not sure what it would be or what is syntactically correct or exactly where to put it. As in, I need heeelp!
Private Sub OK_Click( )
dim r as double = Val(radius.Text)
dim h as double= Val(hght.Text)
dim v as double =MATH.PI * (r ^ 2) * h
volume.Text= Str$(v)
End Sub
What I have is a simple form with 3 lables and text boxes, one for radius, height and volume and one botton that is mrked OK and has the code above input into it.
I am using VB.NET 2003 SE. Please let me know if I need to post more
code, and where I would get it from to post. My many thanks for any assistance.
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
|