Page 1 of 1

Questions etc about WinExec( <command>, <parameter&

PostPosted: Mon Mar 10, 2008 6:23 am
by xProgrammer
Hi Antonio

I am using WinExec() to print postscript files, with calls like this:

WinExec( "lpr", <postscript-file> )

That works fine. But I don't want to clutter up computers with the postscript files. So the logical thing is to erase them. But I am assuming that WinExec() operates asynchronously - in other words the next line of (x)Harbour code may be executed before lpr has finished spooling the postscript file? Is this the case? Can WinExec() be made to optionally operate synchronously and return the exit code of whatever it calls? What alternatives are there? I guess calling a shellscript that spools the postscript file and then deletes it? I could insert a MsgInfo() informing the user that a file has been spooled and hope that that would provide sufficient time delay for the file to have already been spooled.

If you do look at WinExec, please see if you can modify it so that you can use more than 1 parameter.

Thanks
Doug
(xProgrammer)

Re: Questions etc about WinExec( <command>, <parame

PostPosted: Mon Mar 10, 2008 10:27 am
by Enrico Maria Giordano
Try WaitRun().

EMG

Re: Questions etc about WinExec( <command>, <parame

PostPosted: Mon Mar 10, 2008 10:29 am
by Enrico Maria Giordano
Ops! I missed the Linux topic again, sorry. :-)

EMG