External Methods???

How long has the feature to add an external method been in Xojo?
I have no idea how I missed this.
Should I refactor my declares into this format?

there are issues with them :slight_smile:
they are platform specific and its a real pain in the butt to make it so the compiler strips them
so if you currently have declares that exist inside a method and are enclosed by #If Target you’re probably in better shape since those CAN be stripped out and those methods will still compile

basically … no I wouldnt

shame.

lack of exposed compat flags as that would make it possible for them to be stripped out
you’d be able to mark then as windows only, mac only, linux only or combinations of those

<https://xojo.com/issue/56852>

I can make a Module external, but not a Method. How are you doing this?

Add a class
Right click on it.
Add external method.

It’s not about the file, it’s about declares.

[quote=484211:@Chris Halford]How long has the feature to add an external method been in Xojo?
I have no idea how I missed this.
Should I refactor my declares into this format?[/quote]
It depends a lot on whether you want each and every declare exposed. In my experience, most declares are grouped together to do a function or wrapped in a Xojo method to make them friendlier.

[quote=484313:@Chris Halford]Add a class
Right click on it.
Add external method.[/quote]
Ahh, I have external Classes too.

External Classes are very helpful for code reusing of Classes in Server and Client Projectfiles. Sometimes it’s even better to use one Projectfile for Windows and another one for Mac or Linux due the fact of the differences. External Classes are the glue between them.

From my POV as a macOS only developer, I love external methods.

If you EVER want to make a windows version you’ll hate them :stuck_out_tongue:

As I said, they are platform specific and you cant exclude them from a build for a different target easily