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

[amibroker] About 'for' and 'if' (with curly-braces) in Guru. Do they work ?



PureBytes Links

Trading Reference Links


Nirvanaiam,
 
I tried.  However you have commented out 'for', so it did not work.  I wanted to find out if 'for' worked and if multi-statement 'if' using curly-braces worked in Guru or not.
 
It looks as if the 'for' and 'if' with curly-braces for multiple statements is working as expected in the Indicator Builder, but it does not work in Guru.  (I'll give a small code below that works in Indicator Builder.)  Have you seen 'for' and 'if' with curly-braces for multi-statement working in Guru ?  Please give an example if you've seen these work in Guru ...
 
Regards,
- Salil V Gangal
 
Example that works in Indicator Builder
 

rsi14 = RSI(14);
Plot(rsi14,"",colorBlue,styleLine);
Title = " ";
varA = 10;
varB = 20;
if ( varA > varB ) {
    for( i = 0; i < 3; i++ ) {
      Title = Title + " varA is greater than varB ";
    }
}
else {
    for( i = 0; i < 3; i++ ) {
      Title = Title + " varA is not greater than varB ";
    }
}
 
nirvana1x <nirvanaiam@xxxxxxxxxxxx> wrote:
Try this /*** File: loop_test.afl** Title: Testing the Loop** Date: April 19, 2003** Author: Salil V Gangal*/ "First Stamentnt";//for ( i = 1; i < 10; i++ ) " Hello World! ";varA = 10;varb = 20;if ( varA >= varB ) Va=" varA is greater than varB ";else Va= " varA is not greater than varB ";Va;//"Last Statement";--- In amibroker@xxxxxxxxxxxxxxx, Salil V Gangal <salil_gangal@xxxx> wrote:> Friends, I've got following code in Guru.  Any idea why it does not produce the expected O/P?  I'm attaching a screen-shot that shows the version I'm using. Regards,- Salil V Gangal > /*> > ** File: loop_test.afl> > ** Title: Testing the Loop> > ** Date: April 19, 2003> > ** Author: Salil V Gangal> > */ > > "First Stamentnt";> > for ( i = 0; i < 10; i++ ) {> > " Hello World! ";> > }> > varA = 10;> > varB = 20;> > if ( varA > varB ) {> > " varA is greater than varB ";> > }> > else {> > " varA is not greater than varB ";> > }> > "Last Statement";> > > > ---------------------------------> Do you Yahoo!?> The New Yahoo! Search - Faster. Easier. Bingo.Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 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 the Yahoo! Terms of Service. Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.






Yahoo! Groups Sponsor












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 the Yahoo! Terms of Service.