[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Serious Easy Langauge Bug/Problem



PureBytes Links

Trading Reference Links

I think that I have stumbled across a very serious bug/problem with Easy
Langauge.  It has to do
with using Loops.  I am including two sections of code which illustrate
the problem.  They
should produce identical answers but they do not.  The brute force
method works while the
loop does not work.  If the mistake is mine, please point it out to me,
if it is not, please correct
this problem as soon as possible.

Best regards,

Andrew

----------     Code Example # 1     ----------
INPUTS:  Size(5);

VARS:   Counter(0);

ARRAYS:  Recent.High[5](0);

IF ( High[0] = Highest( High, Size ) ) THEN
BEGIN
 Counter = 4;
 FOR Counter = 4 DownTO 1
 BEGIN
  Recent.High[Counter+1] = Recent.High[Counter];
 END;
 Recent.High[0] = BarNumber[0];
END;

Value1 = Recent.High[5];

Plot1(BarNumber,"Bar");
Plot2(Value1,"Val1");
----------     Code Example # 1     ----------

Code Example # 1 does not work.  The only element of the array which
ever has a value is
[0].  The next section of code, which is doing the same thing, just in a
different "manual" way
does work.  They both should work, but the loop method fails.

----------     Code Example # 2     ----------
INPUTS:  Size(5);

VARS:   Counter(0);

ARRAYS:  Recent.High[5](0);

IF ( High[0] = Highest( High, Size ) ) THEN
BEGIN
 Recent.High[5] = Recent.High[4];
 Recent.High[4] = Recent.High[3];
 Recent.High[3] = Recent.High[2];
 Recent.High[2] = Recent.High[1];
 Recent.High[1] = Recent.High[0];
 Recent.High[0] = BarNumber[0];
END;

Value1 = Recent.High[5];

Plot1(BarNumber,"Bar");
Plot2(Value1,"Val1");
----------     Code Example # 2     ----------