Thanks for the help in installing GPC for my new CYGWIN configuration.
It seems to work now.
I want to transfer several pascal programs from a Sun machine (Solaris 7, compiled with Sun Pascal), to GPC.
Could anybody help me e.g. by showing the code to catch some of my cygwin (bash) environment-variables: e.g. 'PWD', 'HOME', 'TERM', ...
How do I ask a 'system call' to be executed from within a GPC program? E.g. assume I want to make a 'ls' of some directory, and to see if there is a file called 'testfile'.
Thanks for your help.
Paul
Paul.Igodt wrote:
Could anybody help me e.g. by showing the code to catch some of my cygwin (bash) environment-variables: e.g. 'PWD', 'HOME', 'TERM', ...
GetEnv
How do I ask a 'system call' to be executed from within a GPC program?
Execute (unit GPC).
E.g. assume I want to make a 'ls' of some directory, and to see if there is a file called 'testfile'.
If you want to capture the results of a system call, see the `Pipe' unit.
However, to find out it a file exists, you don't want to call ls. Instead, see `FileExists' and/or `ReadDir' etc.
Frank
Can anybody give a short example of how I can ask in a pascal program to start another application.
Assume, I want to start "Ghostview" (command name "gv") with filename "test.ps" as parameter, i.e. execute "gv test.ps"
How do I program that in GPC?
Thanks a lot. Good holidays to you all!
Paul
Frank Heckenbach wrote:
Paul.Igodt wrote:
Could anybody help me e.g. by showing the code to catch some of my cygwin (bash) environment-variables: e.g. 'PWD', 'HOME', 'TERM', ...
GetEnv
How do I ask a 'system call' to be executed from within a GPC program?
Execute (unit GPC).
E.g. assume I want to make a 'ls' of some directory, and to see if there is a file called 'testfile'.
If you want to capture the results of a system call, see the `Pipe' unit.
However, to find out it a file exists, you don't want to call ls. Instead, see `FileExists' and/or `ReadDir' etc.
Frank
On 26 Dec 2003 at 8:47, Paul.Igodt wrote:
Can anybody give a short example of how I can ask in a pascal program to start another application.
Assume, I want to start "Ghostview" (command name "gv") with filename "test.ps" as parameter, i.e. execute "gv test.ps"
uses dos;
... ... exec ('cv', 'test.ps'); ...
I would suggest that you took a good look at the files in the GPC "units" directory.
How do I program that in GPC?
Thanks a lot. Good holidays to you all!
Ditto. We Africans still call it "Christmas" ... ;)
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/
On Fri, 26 Dec 2003, Paul.Igodt wrote:
Can anybody give a short example of how I can ask in a pascal program to start another application.
Assume, I want to start "Ghostview" (command name "gv") with filename "test.ps" as parameter, i.e. execute "gv test.ps"
How do I program that in GPC?
Thanks a lot. Good holidays to you all!
Paul
This tiny program works fine on my linux (SuSe 8.2) with gpc version 20030830, based on gcc-3.2.3
PROGRAM t; uses gpc; { <-- this is needed !!} var rc: integer; {takes the return code} BEGIN rc:= execute ('ls -l'); writeln ('ReturnCode=', rc) END.
Happy Christmas to all Ernst-Ludwig