The program shows how to run a Pascal script in Delphi, pass variables and types to a script. The whole process works asynchronously, in threads.
The following article summarizes an experience using RemObjects PascalScript to run scripts in Delphi: My experience using RemObjects PascalScript to run scripts in Delphi.
Clone the Pascalscript GitHub repository and add a link to the ...pascalscript\Source folder to the Delphi Library Paths option.