Stephen Holt
Member
I had used the code for Sqrt in previous calculations but for some reason it does not work this time.
What did I do wrong?
I get a red line under Dim Ans1 As Float. Descript Says: ')' expected.
Thanks in advance.
What did I do wrong?
B4X:
Sub btnCalc_Click
Dim Res As Float = edtResist.Text
Dim Watt As Float = edtWatt.Text
Dim Amp As Float = Watt / Res
Dim Volt As Float = (Volt * Volt) / Watt
Dim Ans1 As Float = Sqrt (Amp As Double) As Double
Dim Ans2 As Float = Sqrt (Volt As Double) As Double
lblAmps.Text = NumberFormat(Ans1, 1,2)
lblVolts.Text = NumberFormat( Ans2, 1,2)
End Sub
I get a red line under Dim Ans1 As Float. Descript Says: ')' expected.
Thanks in advance.