How do I monitor compile progress?

I’ve implemented PascalScript plus an editor into one of our tools, and we use it for code testing (call a lot of stuff from the script and check results). Which means I’ve got a “huge” (20 KB) script that calls some dozens of functions.

Now when the editor compiles this, it might take something from 5 to 20 seconds (testing happens in virtual machines sometimes), during which the calling thread hangs.

I could now separate the compiler from the main GUI, and just display some kind of marquee. But it would be nicer (users like to see “something”, even if its just line numbers or function calls scrolling by) to see some kind of “real” progress.

Does the compiler have any events that would return to me such feedback? I searched for a while, without finding anything. If there is no such event, I would like to have this seen as a feature request :slight_smile:

Hello,
You can control Execute process. Use ‘TPSScriptDebugger.OnSourceLine’ or ‘TPSScript.Exec.OnSourceLine’ events.

Thansk for the reply!

Compile progress is more important to me, I have to admit.

I found TPSPascalCompiler.OnTranslateLineInfo which works there, and is nice. Downside: when using TPSScript, this is set to nil or an internal handler in TPSScript.Compile. It would be better to not make this event visible outside the units if it is used internally. My workaround here was to patch uPSComponent, and setting it to nil only if it has been set to CompTranslateLineInfo before (used PreProcessor before).

Hello,
Thanks, the issue was logged as #50040