[fpc-pascal] Re: It is possible to pass command line to pascal

Guillermo Martínez gmartinez at burdjia.com
Mon Jul 1 09:55:05 CEST 2013


> From: Rainer Stratmann <rainerstratmann at t-online.de>
> Subject: Re: [fpc-pascal] It is possible to pass command line to
> 	pascal
>  On Sunday 30 June 2013 00:59:59 you wrote:
> > I Tried, but only return an integer not a string value.
> 
> Thats right.
> 
> You have to put the result in a file and then afterwards read the
> file.
> 
> ls uname -r > file.txt
> 
> The integer is the result code of the execution.
> It contains information if the execution was successful.
>  

You may also use a TProcess object:
http://www.freepascal.org/docs-html/fcl/process/tprocess.html

Here you have a tutorial with some examples:
http://wiki.lazarus.freepascal.org/Executing_External_Programs#TProcess



More information about the fpc-pascal mailing list