Conditional runnig of modules

Cableguy

Expert
Licensed User
Longtime User
I don't know if this will be possible in the next release, but it would simplify LARGE projects...
The ability to call upon and run modules as if they were seperate programs,BUT not being seperate programs...
Imagine a "task" program...
Instead of programing every task into the exe code, we could program in a way that the "main" exe would execute a specified module ("task") as if it was internal...meaning that all global would still be Globals....
Exatcly as with the Modules, but instead of merging them into the exe, compile them into something else like dll or exe...
 

ceaser

Active Member
Licensed User
Hi Cableguy

I agree there with you. :sign0060:I am busy with a Land Surveying program that exceeds 5mb.

Some of the functions in the program are not very often used and these one should be able to compile as an "external" program.

On the Workabout (from Psion), I have a Land Surveying program and here I will load all the "external" modules, but they are not really loaded. Only once the program needs a function in one of these "external" modules, will this module be loaded in memory. Saves on memory overheads!

Thanks
Michael
 

agraham

Expert
Licensed User
Longtime User
Whilst a .NET application can load and execute separately copiled assemblies transparently sharing Globals between them is not possible. Furthermore once an application has loaded an assembly it cannot be unloaded until the application terminates (there are good code safety reasons for this behaviour) so memory usage would accumulate. Also the Compact Framework lacks most of this facility so unfortunately I don't think that your suggestion is possible - at least not in that transparent way.

Some of the functions in the program are not very often used and these one should be able to compile as an "external" program.
There is a relatively easy way to accomplish this. Compile a separate application that reads its Globals from a file on entry or gets them from its args() and writes anything to pass back to a file on exit. From the main app write the data file then Start the app using the Process object from my Threading library http://www.b4x.com/forum/additional-libraries/1611-threading-library-optimising-compiler.html. The Process object Exit event occurs when the Process exits and the data file then can be read by the main app. Although Threading needs to be optimised compiled to work correctly Process can work correctly in legacy mode.
 
Top