Possible loading of a dynamic class in delphi

I have an environment and I want to know that if I write code in this environment, is it possible to save> compile and use this code?

which is more than what I want the environment to call the function in this code and that the code can call the function in the environment.

I think there was something in java called class loaders that allows you to do this .. can I do this with Delphi and what is the best way to do this?

(just in case, if someone says about putting him there to start with a game for children, they will simply write a section of code regarding simple logic and variables, and will call methods that are in an environment that moves a virtual robot )

+3
source share
3 answers

Delphi has no means to compile code at runtime, but there are many scripting languages. For example, look at PascalScript from RemObjects. It can do most of what you are looking for, although it has no way to create new classes. I do not think any script engine does. But it can import existing ones from Delphi and create new Pascal functions and procedures for the interaction of your program.

+5
source

You can do what you need to do using paxCompiler .

+2
source

, freepascal dll, delphi. , " Delphi .

+1

Source: https://habr.com/ru/post/1750925/


All Articles