Reputation: 49
When an application is already running (runtime), is it possible to dynamically load a .pas file and use it?
Upvotes: 1
Views: 1261
Reputation: 597051
A .pas
file must be compiled into a .dcu
file and linked into an executable (program or library) before it can then be executed at runtime.
If you need to load and execute the code dynamically, you can compile the unit into a runtime Package (bpl) first, and then load that file at runtime using the LoadPackage()
function. See the following articles for more details:
Loading Packages in an Application
Loading Packages with the LoadPackage Function
How to dynamically load and call a function in a BPL package
Upvotes: 6
Reputation: 613262
The simple answer to your question is no. Pascal is source code and cannot be executed directly. It must first be translated one way or another.
Upvotes: 0