I tried putting writeln in the macro code to inspect the vaue of variables the macro is/was using. The macro interpreter didn't like the writeln at all. My question is: when I want to verify that some macro variable has the value I want it to have, how do I do that given that writeln isn't available ?Actually good question.
Another question: if I wanted to add lines at the end of the current file, how do I do that ? I know about Caller.Lines and LineCount but, if I have a line in a string, how do I add/append that string to the Lines array ?Actually "Lines" is read only. Writing to it would break the IDE's undo capability, so its readonly for technical reasons.
To make up for the time you and others may invest in educating me (along with my own self education), I figured that, at the end of the whole experience, I would write a tutorial that would answer all the questions I had to, hopefully, make things easier for a "macro-newcomer".That will be welcome.
At least under Windows, OutputDebugString ends up in the Event log debug window.
At least under Windows, OutputDebugString ends up in the Event log debug window. That is maybe a better alternative than ShowMessage?Yes, there would be some advantages to using OutputDebugString instead of ShowMessage but, how do you get PascalScript to use OutputDebugString ?
It has been a while, but I think that you can register it to PascalScript.Maybe, but the version for Editor Macros does not have it registered. And this thread is about how to debug an editor macro.
At least under Windows, OutputDebugString ends up in the Event log debug window.
I understand that 440bx wants to run under the debugger, hence I gave this code.
I am really not sure if it is an answer, but it works at least under Delphi.
I assume also under Lazarus or FPC.
Well, I Implemented this for PerfectView in the 1999's and early 2000's and there it worked. We should be able to make it work for Lazarus, the {$apptype console} will give a console window for the script output anyway.
Script or exe.