SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : TA-Quotes Plus -- Ignore unavailable to you. Want to Upgrade?


To: Bob Jagow who wrote (5357)7/11/1998 6:14:00 PM
From: Bob Jagow  Read Replies (1) | Respond to of 11149
 
Ran out of edit time, gang. Corrected version follows.
----

To elaborate on parse-time vs run-time errors in qp2,
----------------------
b := (S*Sxy - Sx*Sy)/(S*Sxx - Sx*Sx);
if b = 0 then print symbol,"b was zero with j: ",j; endif;
pctgain := abs((b1/b) -1);
--------------------

fails with a parse-time div by 0 error, even though commenting out the pctgain line shows b isn't 0 at run time.

The parse-time error is fixed by
-----------
b := .0000001+(S*Sxy - Sx*Sy)/(S*Sxx - Sx*Sx); // kludge
-----------

or by enclosing pctgain in if ... endif.
-------------
b := (S*Sxy - Sx*Sy)/(S*Sxx - Sx*Sx);
if b != 0 then
pctgain := abs((b1/b) -1);
endif;
-------------

It is also amusing that, though numdays is rejected at parse-time in Jan's
------
NumDays:= -(daysloaded -1);
println NumDays, Max(0, NumDays, hi);
-------
negating NumDays by
-------------
println NumDays, Max(0, -NumDays, hi);
-----------------
works fine, but it always returns zero.
That is, +255 is accepted by Max, but it punts with zero since it can't predict the future ;)

Can you easily fix these parse-time check errors, Gary?

Bob