|
-
Apr 30th, 2013, 04:53 AM
#9
Re: Simple multiplication progran help needed
Hi,
If Single.TryParse(Lengthbox.Text, Length) AndAlso Single.TryParse(Width.Text, Width) _AndAlso Single.TryParse(Thicknessbox.Text, Thickness) AndAlso Single.TryParse(Ratebox.Text, Rate) Then
'Write your valid calculation code here
Length = Lengthbox.Text
Width = Widthbox.Text
Thickness = Thicknessbox.Text
Rate = Ratebox.Text
I managed to fix the code but I still dont know how to use:
If Single.TryParse(Lengthbox.Text, Length) AndAlso Single.TryParse(Width.Text, Width) _AndAlso Single.TryParse(Thicknessbox.Text, Thickness) AndAlso Single.TryParse(Ratebox.Text, Rate) Then
'Write your valid calculation code here
The first thing to do if there is something that you do not understand is to read the Documentation for the method that you are using. MSDN has a wealth of information on every Method and Property for Every Class and Type in VB.NET. Have a look here on the Single.TryParse method:-
http://msdn.microsoft.com/en-us/library/26sxas5t.aspx
Once you have read this you should be able to structure your code correctly.
With regards to rounding, have a look here:-
http://msdn.microsoft.com/en-gb/library/zy06z30k.aspx
Hope that helps.
Cheers,
Ian
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
|