external items in more than one project?

I feel like a total noob that I can’t figure this out. I’ve been using the xojo and so many other versioning things for so long but in xojo I’ve never had the need to share a file between 2 projects. I’ve got a module with a large number of constants in it for data keys necessary for the communication between 2 apps. For years I’ve just cut and pasted any changes or additions into both apps. I’m facing a large number of additions now and I want the module to be the same in both projects. As if I was including the same header file into both of them so that changes in one will be reflected in the other.

The “make external” feature seems to be what I want? I can make the module external and save it from one program, but how do I import it as external in the other? If I drag it into the second project it’s imported just once and kept locally. If I go to make that one external then it wants to save it again.

Is that how to do it? Just save it over the other and then both programs will treat it as an external item?

This seems such a basic thing, yet I’ve never done it in Xojo!

Just saving it again over the existing external item is how I usually do it.

On Mac, just drag the module over the project holding OPTION+CMD, the cursor will turn to an alias style arrow and the module is added as external.

Be warned with external modules to not work at the same time on both project using it. Bad things can happen

Also with external modules you must save the project in XML or Binary only.

[quote=220498:@Massimo Valle]On Mac, just drag the module over the project holding OPTION+CMD, the cursor will turn to an alias style arrow and the module is added as external.

Be warned with external modules to not work at the same time on both project using it. Bad things can happen

Also with external modules you must save the project in XML or Binary only.[/quote]
The MODULE has to be XML or Binary - not the project
You can use external in VCP projects

This used to be true in older versions of REALbasic, but is not any longer: I’ve been working with a client/server app with shared external XML xojo modules, classes, and windows, and can edit both projects in the IDE simultaneously. I’ve not seen any issues.

Can you clarify what you are seeing?

[quote=220507:@Norman Palardy]The MODULE has to be XML or Binary - not the project
You can use external in VCP projects[/quote]

Yeah, I forgot about this, because IMHO makes little if no sense to have project half in text and half in XML.
see: <https://xojo.com/issue/3624> (22th place)
and: <https://xojo.com/issue/8265> (16th place)

Oh I know those well
To be honest they’re unlikely to happen for a variety of reasons given how VCP works

[quote=220509:@Michael Diehr]This used to be true in older versions of REALbasic, but is not any longer: I’ve been working with a client/server app with shared external XML xojo modules, classes, and windows, and can edit both projects in the IDE simultaneously. I’ve not seen any issues.

Can you clarify what you are seeing?[/quote]

Well, I stopped doing this time ago due to incompatibility with our SDC workflow and namespaces (nested modules) which are also not supported.
Maybe now things are better, glad to see they improved.
Again: <https://xojo.com/issue/8265>

[quote=220514:@Norman Palardy]Oh I know those well
To be honest they’re unlikely to happen for a variety of reasons given how VCP works[/quote]

[quote=220514:@Norman Palardy]Oh I know those well
To be honest they’re unlikely to happen for a variety of reasons given how VCP works[/quote]

Something being at 16th place on the requests from users can’t be simply marked as “unlikely to happen”. :frowning:

Unlikely to happen = give norm 6 months to do NO work on anything else in the IDE (no bug fixes etc) to craft a new file format that makes the issues with VCP, Binary & XML go away

unlikely to happen

Ah, command-option. I tried all the command keys in singular form but didn’t try combining them :wink: Just like in the finder I see.

Norman, is the warning to not have both projects open at once still important? That would be a pain…

Shouldn’t be
The IDE communicates changes to common items to all other documents so this should be fine

We dont use a lot of externals in the IDE project which is where I spend 99% of my working time

excellent, then I shall experiment and let you know if anything really exciting happens :wink:

cool

the cases max mentions I’d love to solve BUT there are a bunch of related ones that if we do anything we really should fix them all or at least design things so we can

hence the “6 months” estimate

it’s a big job to alter that much legacy code

I got lots of legacy code I wrote with all your legacy code :wink: So I’m completely on board…

You can also Copy/Paste the original ‘alias’ module from the original Xojo project into the second (or third…) project. I find this faster than finding the original external item then holding down special keys as I drag it into the wrong place!