User Profile
Collapse
-
Didn't realise the variable defaulted to variant when done one line. Thanks -
-
Declaring variables on same line fixes overflow
I have a program to calculate wattage from voltage and amps. If I declare V and I on different lines, then I get an overflow when V = 1000 and A = 100. If I declare them on the same line, then the overflow is fixed and doesn't occour
...Code:Private Sub cmdCalc_Click() Dim W As Long Dim Amps As Integer Dim Voltage As Integer Voltage = CInt(txtVolts.Text) Amps = CInt(txtAmps.Text)
No activity results to display
Show More
Leave a comment: