[Qt-interest] How to implement something like "#include" into a QtScript environment?

Bastian Bense bastibense at gmail.com
Tue Dec 1 17:32:05 CET 2009


Hey fellas,

I'd like my users to break their very large scripts into smaller, logical
chunks.
Just like with C/C++, a #include directive would be useful, where the
directive is replaced with the specific code prior to
compilation/evaluation.

Example:

#include "some other code snippet"

callOtherCodeSnippetMethod()


One idea was to use the principle of pre-processing the user script,
replacing all #includes with their respective contents. Alternatively I
could use a runtime include() command, but that would require me to evaluate
code recursively - I'm not even sure if QScriptEngine supports that.

Any ideas or thoughs on this? :)

Thanks!

Bastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091201/4bd9c441/attachment.html 


More information about the Qt-interest-old mailing list