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

RE: [amibroker] #define directive ?



PureBytes Links

Trading Reference Links


Graham,
 
The #define directive allows one to write in short-hand rather than writing  long code.  The compiler substiututes the short-hand into its full form before executing it.
 
As an example, say if one is writing the following again and again and again in the program ==>
 
WriteIf ( LastValue(security) > LastValue(security45ema), "Price is above it 45 ema","Price is not above 45 ema");
 
Then one can just define the short-hand 
 
#define WRITE45_EMA   WriteIf ( LastValue(security) > LastValue(security45ema), "Price is above it 45 ema","Price is not above 45 ema");
 
And the within the program then one needs to write just WRITE45_EMA which will mean writing whole of 'WriteIf ( LastValue(security) > LastValue(security45ema), "Price is above it 45 ema","Price is not above 45 ema");' ! 
 
This comes in very handy when one has very large code.  It cuts down typing a lot.  Languages like C, C++ support #define.  Since AFL already supports #include, which is similar to C, C++, I am wondering if there is plan to add #define for AFL also ...
 
Regards,
- Salil V Gangal Graham <gkavanagh@xxxxxxxxxxxxx> wrote:





What is #define represent ?
 

Cheers,Graham
http://groups.msn.com/ASXShareTrading
http://groups.msn.com/FMSAustralia
-----Original Message-----From: Salil V Gangal [mailto:salil_gangal@xxxxxxxxx] Sent: Monday, 19 May 2003 9:40 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] #define directive ?
 

Tomasz,

 

There is #include in AFL, but AFAIK there is no #define in AFL.

 

Are there any plans to add #define as well ?  With ever increasing length of AFL scripts, I'm sure that #define will cut-down lot of typing while writing AFL scripts.

 

 


Friends,

 

Are there any work-arounds for #define in AFL ?

 

Regards,

- Salil V Gangal 



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. 
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.