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

RE: [amibroker] for loop



PureBytes Links

Trading Reference Links

No, but you can apparently fake it via index manipulation--see the pasted reply from Tomasz below. -Bob.
---
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.
> 
-------

-----Original Message-----
From: aequalsz [mailto:aequalsz@xxxxxxxxx]
Sent: Tuesday, June 03, 2003 9:12 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] for loop


I'm translating a Metastock Developers Kit C++ code to Amibroker AFL
but have hit a minor snag.  Is there any way to prematurely BREAK out
of a for loop?

a



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 Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/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/