Right, Peter, you can write an explicit if in R2 to test for the div/0-- --------------------- YearlyLow:= Min(-1,-250,cl); if YearlyLow > 0 then CPM:= Close(0)/YearlyLow ; endif; ---------------------- But, unfortunately, ------ If YearlyLow > 0 and Close(0)/YearlyLow > 1 then println symbol; endif; ------------------- would crash with a div/0 for the same reason your original ----------------- YearlyLow:= Min(-1,-250,cl) YearlyLow > 0 CPM:= Close(0) / YearlyLow ----------------- crashed--neither R1 nor R2 implement 'short-circuit' evaluation. Lack of this feature, which is standard in most modern languages except Pascal (Wirth fixed that for Modula), also impacts how you should write R1 and R2 scans. Since all conditions will be evaluated (AllGroup cond1 cond2 cond3 is identical to if cond1 and cond2 and cond3 then), a prescan to narrow the original database to stocks of interest to you will speed things considerably.
Exiting my soapbox ;) Bob |