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

Re: [amibroker] Breaking out of a for(; ; ) loop



PureBytes Links

Trading Reference Links

Hello,

1. 'break' statement is not implemented (and I don't give any
warranty it will be, although I am thinking of it)

2. No, array is not filled with zeros. Internally it is just malloc()-ed

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Michael Orlyk" <bmwrider@xxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, April 17, 2003 2:59 AM
Subject: [amibroker] Breaking out of a for(; ; ) loop


> Please confirm that the break keyword has no functionality in the new 
> AFL for(;;) loops.  As an example the following code snippet did not 
> produce a break out of the loop when executed yet AFL didn't complain 
> about the presence of the key word break:
> 
>   for(i=1;i<BarCount; i++) {
>      if (H[i] > H[i-1]){
>        y[i] = H[i];
>        if (y[i] >= 22.00)
>           break;  // did not cause an exit out of the loop
>      }
>      else
>        y[i] = L[i];
>    }
> 
> As a work around I coded the loop as follows to simulate a break:
> 
>    for(i=1, j=BarCount; i<j; i++) {
>      if (H[i] > H[i-1]){
>        y[i] = H[i];
>        if (y[i] >= 22.00)
>           j=i;
>      }
>      else
>        y[i] = L[i];
>    }
> 
> I also have a question:  when an array variable is declared, can I 
> assume all the array elements are initialized to zero?
> 
> Thanks ...
> 
> Mike O.
> 
> 
> 
> 
> 
> 
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
> 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get a FREE REFINANCE QUOTE - click here!
http://us.click.yahoo.com/2CXtTB/ca0FAA/i5gGAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/