PDA

View Full Version : Run time error help



4907
09-16-2016, 05:37 PM
I get this error when I test my code and after debugging this line gets highlighted. I've looked up what the error means but can't seem to figure out how to fix it.

1709717098
Thanks!

mana
09-16-2016, 05:57 PM
Write "Option Explicit"


Dim x1 as double
Dim x2 as double
Dim xr as double
Dim es as double
Dim n as long

4907
09-16-2016, 06:11 PM
Now it's saying "Compile error:Variable not defined" and highlighting the Sub secant() line

mana
09-16-2016, 08:57 PM
declare all variables


Dim x1 as double
Dim x2 as double
Dim xr as double
Dim es as double
Dim n as long

mana
09-16-2016, 09:16 PM
function procedure


private function fx(x as double) as double
fx=(-x^2)+x+0.75
end function