#include in a script

I am trying to load one script program in an ops file using functions defined in another ops file. I manage to do this calling:
scripting.loadPrograms("file_with_my_functions.ops")
and then:
scripting.loadPrograms("file_with_my_program.ops")

But, as I saw that "include" is a keyword in Orocos scripting language, I thought I could write something like:
#include "file_with_my_functions.ops" at the beginning of my program and then only call:
scripting.loadPrograms("file_with_my_program.ops")
I did not find any documentation about it, and it seems no to work (no loading problem but no effect).

If anybody knows if (and how) the include functionality works in Orocos scripting language, I am interested !

Renaud Heitz

#include in a script

On Monday 23 March 2009 16:22:17 renaud [dot] heitz [..] ... wrote:
> I am trying to load one script program in an ops file using functions
> defined in another ops file. I manage to do this calling:
> scripting.loadPrograms("file_with_my_functions.ops")
> and then:
> scripting.loadPrograms("file_with_my_program.ops")
>
> But, as I saw that "include" is a keyword in Orocos scripting language, I
> thought I could write something like: #include "file_with_my_functions.ops"
> at the beginning of my program and then only call:
> scripting.loadPrograms("file_with_my_program.ops")
> I did not find any documentation about it, and it seems no to work (no
> loading problem but no effect).
>
> If anybody knows if (and how) the include functionality works in Orocos
> scripting language, I am interested !

We just reserved that keyword for future use :-/. The only way to merge
multiple scripts is by using the 'cpp' preprocessor yourself in combination
with #include directives. You should then only load the preprocessed file.

On the other hand, it isn't such a big addition to support 'include' in the
scripting language, but then the 'include path' feature would be needed to,
which is less evident to specify in our setting.

Peter