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

Re: [amibroker] Conditional #include



PureBytes Links

Trading Reference Links

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 
  To: amibroker@xxxxxxxxxxxxxxx 
  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