Professional Documents
Culture Documents
Codigo VB6
Codigo VB6
vel = Val(Text1.Text)
vi = Val(Text2.Text)
de = Val(Text3.Text)
dint = Val(Text7.Text)
rug = 0.00006
Text4.Text = NR
Select Case NR
f = 64 / NR
Text6.Text = f
Laminar.Visible = True
Label5.Visible = True
If Er < 5 Then
f = 0.3164 / NR ^ 0.25
Text5.BackColor = RGB(255, 0, 0)
Text6.Text = f
End If
t = (f) ^ 0.5
ap = 1 / (f ^ 0.5)
f=t^2
Exit For
Next
Text5.BackColor = RGB(255, 0, 0)
Text6.Text = f
End If
If Er > 70 Then
f = 1 / (1.14 - 2 * Log(Er)) ^ 2
Text5.BackColor = RGB(255, 0, 0)
Text6.Text = f
End If
End Select
End Sub
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text1.SetFocus
End Sub
CMD.ShowPrinter
Printer.Print ""
Printer.Print "Velocidad"
Printer.Print (Text1.Text)
Printer.Print "Viscosidad"
Printer.Print (Text2.Text)
Printer.Print "Densidad"
Printer.Print (Text3.Text)
Printer.Print (Text7.Text)
Printer.Print ""
Printer.Print (Text4.Text)
Printer.Print ""
Printer.Print (Text5.Text)
Printer.Print ""
Printer.Print (Label6.Caption)
Printer.Print ""
Printer.Print (Text6.Text)
Printer.EndDoc
End Sub
End
End Sub
End Sub
Private Sub Form_Load()
Laminar.Visible = False
Label5.Visible = False
End Sub
Text2.SetFocus
End If
End If
If Not ((Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Or (Chr(KeyAscii) <= "/"
Or Chr(KeyAscii) = "E")) Then
Text1.Text = ""
Beep: KeyAscii = 0
End If
End Sub
Text2.SetFocus
End If
End If
If Not ((Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Or (Chr(KeyAscii) <= "/"
Or Chr(KeyAscii) = "E")) Then
Text2.Text = ""
Beep: KeyAscii = 0
End If
End Sub
Text2.SetFocus
End If
End If
If Not ((Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Or (Chr(KeyAscii) <= "/"
Or Chr(KeyAscii) = "E")) Then
Text3.Text = ""
Beep: KeyAscii = 0
End If
End Sub
Text2.SetFocus
End If
End If
If Not ((Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Or (Chr(KeyAscii) <= "/"
Or Chr(KeyAscii) = "E")) Then
Text7.Text = ""
Beep: KeyAscii = 0
End If
End Sub