Calling a method in a Worker from JobRun

Are you meant to be able to call a method in a Worker object from the JobRun event handler of the same Worker object? The reason I ask is I have one project where this works for one method and not another. For the second method the app builds but the worker is non-existent in the compiled app. For my second project I get an error during build “This item does not exist (in Worker console project)” when I try to call a method from JobRun.

I get that the contents of JobRun will run in a console app, just not sure how I can call code outside of this event handler.

Xojo 2023r3 - building for macOS Universal

For now I’ve created a new class with a shared method that contains code that I want to share between my desktop app and my worker. When I add this class to the ‘Project Items To Include’ list of the worker, I’m able to call this shared method from the JobRun event handler.

You can put shared code in a Module and include that in the worker.

Thanks @Tim_Hare . I just tried this again and works now. Must have messed something up yesterday while trying this. Thanks