MetaTrader4 '#import' probs -- Have U used ?

Discussion in 'Trading Software' started by Tandem, Nov 5, 2005.

  1. Tandem


    Howdy all

    Can you lend a hand here...yes?

    Below I have set out the current environment as relates to the library file and the calling file.

    The LIBRARY file:

    -- I extracted some global functions and put into separate .mq4 file.
    -- I placed this compiled lib file in "...\libraries\" where stdlib is.
    -- Compiler warned about no start(). I put in dummy/empty one.
    -- Compiler warned that since functions not referenced they would be removed from .ext o/p file. I put dummy calls to functions in start() to satisfy reference requirement.
    -- Clean compile -> .ex4 achieved.

    The CALLING / REFERENCING .mq4 file:

    -- At top of calling .mq4 source is:
    #import "loggerLIB_0-1-0.ex4"
    bool errorFound ( string msgHdr="" );
    void errorMessage( string msgHdr, int err=EMPTY );
    int getBarNum ( datetime barDT );

    -- Within .mq4 are the same/untouched original function calls (which worked correctly when (the now external/placed into lib file) functions were part of the source file).


    1. Where does compiler look when sees #import "..." ?
    2. Can formal parameter list contain syntax "(...,int i=0)" ?
    3. Further to 2., should that exact formal parameter list be in callers #import block or just "(...,int i)" ?
    4. Basically - is syntax "(...,int i=0)" allowed in this library envionment - or only valid in same source syntax usage ?
    5. Presently compiler complains about every actual call to functions described in #import block. Why?
    6. None of the compiler errors map to the #import block source line numbers. But obviously are related...?

    Any information I've missed etc. please say

    Thank you very much in advance