Include files or similar?

I can’t find any method of dynamically including module files stored somewhere else in a project.

There’s templates, but aren’t those just static files that are included once when a project is based on that template?

I read the starter PDF’s but it’s not clear.

Did you check the File menu (Import xyz or Export xyz) ?

It is possible to export a window from a project (for example) to disk and to import it into another project.

I tried the import option in the file menu, but the only option is to import a binary project, and it just seems to open the project I select, not allow me to pick and dynamically link to a specific module or file from that project.

To clarify…

What I’m looking for is picking a module file that I have created as a function library and link to it, not include it statically, so if I change something in the original, the changes are available in the project that links to it.

Yes, so you have first to export it. How ? Don’t know, never done.

Also, do you use the free IDE or do you have a valid license ?
I do not care about that, but it can be a “valid license only” feature…

Get an eye on Pages 29, 57, 58 and 152 of the UserGuide-Fundamentals.pdf file.

Also: a right click / ctrl-click on the module entry (navigation pane), you will find two items:

Make external… Export <module-name>…

A Search in the PDF helps, but one have to know the word to type (I tried Export here), else nothing is returned. :slight_smile:

Export the module to a file, delete it from your project, then drag the newly-exported file back into the project while holding down command-option (control-alt in Windows, I think). The module will reappear in your project in italics meaning that it is now external to your project and any changes will propagate automatically to any other project that uses the same module externally.

Got it, thanks to both for helping.

I’m wondering though, why all the fuss with exporting in special formats etc… for something as trivial as an include file?

A lib folder, include directive with options for including outside of lib folder… done.

Xojo is a visual environment, and this is the visual way to do it.

You can export the module as XML too, btw.

There’s no place to put an include directive that would function anything like C’s include near the top of an implementation or header file.

If you make a module / class external then you can share it around among as many projects as you want and every project that uses it gets what ever updates.

Yeah i found out about the xml export, that works.

Are there any code managers for Xojo? Like snippets with search etc…?

I’ve looked around but found nothing that hooks directly into Xojo.

In case others do a search for this.

To link a module that’s made external drag it into any project with shift+control (Windows)

Works as I wanted, just gotta get used to another way of doing things I guess.

Check out Paul’s CodeVue.

Xippets - https://forum.xojo.com/7193-xippets-has-new-bits

Sharing code in this manner is also covered in User Guide Book 4: Chapter 5: Code Management, Section 1: Sharing Code Between Projects.

Thanks for the links guys, evaluating them now.

I’m gnawing my way through the PDFs documentation, bit slow but I’m getting there.