visual studio - Simple calculation in VB.Net -
i want calculate reynolds number using vb.net
this code:
public class form1 dim vis integer dim den integer dim hd integer dim vl integer dim re integer private sub button1_click(sender object, e eventargs) handles button1.click vis = int(textbox1.text) den = int(textbox2.text) hd = int(textbox4.text) vl = int(textbox5.text) re = (den * vl * hd) / vl textbox3.show(re) end sub end class
see ui here.
why still getting error message "too many arguments" ?
there few things wrong in code posted, firstly calculation wrong reynolds number. second, please turn on option strict
current code not compile. third please use conventional naming conventions makes difficult in long run... there's more not point...
suggested solution
variable declaration meaning:
- d = diameter of pipe
- v = velocity of liquid
- u = viscoscity of liquid
- p = density of liquid
tot = reynolds number
private sub button1_click(sender object, e eventargs) handles button1.click dim d,v,u,p,tot single if single.tryparse(textbox1.text,d) andalso single.tryparse(textbox2.text,v) andalso single.tryparse(textbox3.text,u) andalso single.tryparse(textbox1.text,p) tot = (d * v * p) / (u * 0.001) messagebox.show(tot.tostring) 'or textbox3.text = tot.tostring end if end sub
Comments
Post a Comment