Put #include at the beginning of the code and then call the function in the if clause.  For example:
 
#include <test.afl>
z = 0;
/*Test Function called by include
function ftest(x, y)
return x * y; */
option = paramtoggle("option", no|yes, 0);
if(option == 1)  z = ftest(12, 12);
plot(z, "z", colorwhite);
 
Bill
----- Original Message -----
From: laster
Sent: Friday, September 22, 2006 11:29 PM
Subject: [amibroker] Conditional #include

Hi,

I am trying to create a ParamToggle group that would include different files. The result is that the files get included even though they are inside if statements. I guess the answer is to create functions and call them from the ParamToggle?

 

OptionT = ParamToggle("Options?", "No|Yes" ,0);

if(OptionT==True) #include <Options.afl>;

 

Thanks in advance for any comments,

Jerry


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.6/453 - Release Date: 9/20/2006
__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html






SPONSORED LINKS
Software support Small business finance Business finance online
Business finance training Business finance course

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to