Re: [amibroker] Where to put Global Function?

 

Hello,

Thank you very much for your e-mail.

You are mixing up the terms.

A local function is a function defined within (inside) another function or class.

There are no "local" functions in C and there are no local functions in AFL,
there are only global functions, i.e all functions are defined in global scope.

What you meant in C-speak is actually called an "extern" function.
In C you need to use #include to provide declarations/prototypes of extern functions.

In AFL, for the function to be visible its definition must be visible to running formula.
One method to achieve this is to put that function inside separate file and use
#include or #include_once

http://www.amibroker.com/guide/afl/_include.html

Best regards,
Tomasz Janeczko
amibroker.com

On 2016-04-07 12:19, meanomalist@yahoo.com [amibroker] wrote:
I want to write a global  function which is accessible everywhere in AFL environment. I just need to call it any where in any afl.

where to define such function?



__._,_.___

Posted by: Tomasz Janeczko <groups@amibroker.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? The Yahoo Mail app is fast, beautiful and intuitive. Try it today!

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___


EmoticonEmoticon