Hello.
My problem is how to write a formula in vb.
I searched everywhere, and nothing
I write a code, but i get overflow error.
When it gets overflow these turns yellow:
I don't know if this:
, is written correctly.
Any idea or suggestion?
Thanks.
My real formula looks like this(is one of the tree formula that i have to write)
Cmax (X) = 2*QT/((2*π)^3/2)*σx*σy*σz
My problem is how to write a formula in vb.
I searched everywhere, and nothing
I write a code, but i get overflow error.
Rich (BB code):
Option Explicit
Const Pi = 3.14159265358979
Const B = 2
Const C = 1.5
Const D = 8
Const E = 4
Private Sub chkRezultat_Click()
Dim X As Single, Y As Single, Z As Single, W As Single
txtRezultat.Visible = True
'here i type the formula
X = B * Val(txtQT.Text)
Y = B * (Pi) ^ C
Z = Val(txtsigmax.Text) * Val(txtsigmay.Text) * Val(txtsigmaz.Text)
W = X * Y
txtRezultat.Text = Val(W) / Val(Z)
'here is how the formula should look like
'txtRezultat.Text = ((B * Val(txtQT.Text)) / Val((B * Pi) ^ C)) * Val(txtsigmax.Text) *Val (txtsigmay.Text) * Val(txtsigmaz.Text)
chkRezultat.Value = False
End Sub
Rich (BB code):
txtRezultat.Text = Val(W) / Val(Z)
Rich (BB code):
Dim X As Single, Y As Single, Z As Single, W As Single
Any idea or suggestion?
Thanks.
My real formula looks like this(is one of the tree formula that i have to write)
Cmax (X) = 2*QT/((2*π)^3/2)*σx*σy*σz