There are many conditions which will generate these errors.
Two of the usual suspects are trying to do an array comparison with values which have not been properly initialised and hence you're trying to compare a float to a garbage value; or, depending on the version of the compiler, these errors can be thrown when performing mathematical operations on unlike datatypes when one of them is a float.
Use a try-catch block to isolate the error, or run through using the debugger and check all the values used in every comparison/operation.
wabbit
"The question of whether a computer can think is no more interesting than the question of whether a submarine can swim."
Edsgar W. Dijkstra
MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK
For custom MetaStock programming : http://www.wabbit.com.au
My SkyPE status : 
My SkyPE account : wabbit.com.au