Dear ALL,
For many moons have I been struggling with an annoying problem which, being annoying, only appears under MS-Windows. Since it is not a critical problem, just a cosmetic one, I have postponed it but now it is time to tackle it seriously in the hope of solve it at once!
Notice that this problem only affects MS-Windows and to be checked it requires a local installation of the R system for statistical computing and graphics (freely available from here:
http://www.r-project.org/)!
So, for the problem itself: I want to call R from a FPC/Lazarus program, passing it a script file with valid commands in the R language. For that, I use the handy, multiplatform, RunCommand from the Process FPC/Lazarus unit. It works fine - except that, under MS-Windows, an ugly (empty) console screen is flashed in the face of the user, even if the "poNoConsole" flag is properly set! Needless to say, this problem does not appear under GNU/Linux, where R is called without any console screen being displayed.
Why is this so? May best guess (which may be completely wrong) is that to execute an external program, MS-Windows in fact calls the command interpreter "C:\Windows\System32\cmd.exe" and therefore the poNoConsole and other RunCommand flags have no effect because they should in fact be passed to the command interpreter and not to the process being called by the function.
I hope that there is some little, but arcane, trick to solve this problem (out there, where the truth is!). Presuming it does exist, could someone kindly share it with me?
To illustrate the problem, I attach a very simple sample project.
Thanks in advance for any assistance you can provide.
With
best wishes,