Hello Sir,
The previous example u sent was clear. But I have a problem in
reassigning variables i.e. ' In' and 'Out' for multiple files. I attempted
this coding. But only one file gets converted to PDF.
for Int in 1;Int<10;Int+1
do
{OS.pipe 'txt2pdf' ['C:/usr/'#Int#'.txt'] Pid In#Out}
{OS.read In 1000000 L nil I}
{Inspector.configure widgetShowStrings true}
for Line in {String.tokens L &\n} do
{Inspect Line}
end
end
Also, I tried using arrays. The problem still prevails. Kindly help.
Regards,
Kanchana
On 3/13/07, Raphael Collet <[EMAIL PROTECTED]> wrote:
kanchana vasudevan wrote:
> Hello Sir,
> The example which you had sent was very helpful. In this
> regard, I would like to know how the variables 'In/Out' are assigned to
> the file descriptors in the command
> {OS.pipe 'ps' ['-A'] Pid In#Out} and how it can be reassigned to
> multiple files?
The documentation states that OS.pipe has two inputs and two outputs.
In the call
{OS.pipe CmdV ArgsVs PidI StatusT}
CmdV is the command to run, ArgsVs is the list of parameters of the
command. When the call returns, PidI is unified with the process id
number, and StatusT is unified with a tuple of two integers, like 5#6.
The tuple of integers can be unified with a tuple of variables. So if
you call OS.pipe with
{OS.pipe 'ps' ['-A'] Pid In#Out}
and the second output is 5#6, there will be a unification In#Out=5#6,
which will assign the variables In and Out as: In=5 and Out=6. It is as
simple as that.
Cheers,
raph
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users