Lech,

I never worked with the "standard include path", but this is the way 
I use #include and I guess this should work for you as well:

Open the code window of 

C:\ProgramFiles\AmiBroker\Formulas\MyPr\PR2.afl

and add the line below as FIRST line in your code:

#include "C:\Program Files\AmiBroker\Formulas\MyPr\PR1.afl"

This is essentially the same as if you would COPY/PASTE the complete 
PR1 code above the PR2 code (in your PR2 code window). 

The #include statement kind of replaces the copy/paste, because it 
enables PR2 to "grab" functions and indicators etc. from PR1.

So you should write your PR2 code as if everything in PR1 is also in 
PR2.

Again, this has nothing to do with the standard include path with 
which I'm not too familiar.

-treliff

--- In [email protected], "credos_77" <[EMAIL PROTECTED]> wrote:
>
> I'm asking again about help in a very simple case. As I see, many 
> people in the group have the same or a similar problem. The problem 
> is about transferring or using the same constants or values from 
one 
> program to another program (.afl) in AmiBroker. I got information 
> from AB support that I should use function " #include".  I did 
> everything what says the instruction for function "#include" and 
> still the error occurs. 
> I would like to somebody from group or AB support to write how it 
> can be done using very simple example, which can be really helpful 
> for others AB's users and me.
> 
> For example:
> ·     I create a program with name "PR1", path  
> C:\ProgramFiles\AmiBroker\Formulas\MyPr\PR1.afl
> 
> ·     I write code in this program:
> Function ind()
> { r1 = RSI(10);  r2 = RSI(20);  return r1/r2; }
>      
> ·     In Tools -> Preferences -> AFL -> Standard include path - I 
> pick my path:
> C:\ProgramFiles\AmiBroker\Formulas\MyPr
> 
> ·     Now I create the second program "PR2", path
> C:\ProgramFiles\AmiBroker\Formulas\MyPr\PR2.afl
> 
> ·     I want to use, earlier written in program "PR1" function ind
> (), in program "PR2"
> 
> ·     For example:
> I want to multiply "ind()" by "Close" [A = ind()*Close]  and after 
> that draw a plot in "PR2"
> 
> #include <PR1>        and what next?
> How can I invoke (initialize) "ind()"  in order to multiply it and 
> draw a plot in "PR2"?
> 
> 
> Thanks for any help
> Lech
>







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

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to