Lars K. Schunk
11/13/2005 10:20:00 AM
Okay, here's my new problem:
I have a command line program that takes a text file as input and produces
another text file. I want to create the input text file from within Axapta,
then pass this text to the command line program, and finally receive the
output text in Axapta again.
At the moment, I'm using a rather ugly solution. I create the text in a
TextBuffer object, write this buffer to a file, run WinAPI::shellExecute()
passing in the command line program, which produces the output file, and
finally I read this file into another TextBuffer object. This can be a
problem when Axapta runs ahead of the disk operations and cannot read the
file produced by the command line program because the file is in the process
of being created when Axapta attempts to read it.
Q1) The command line program is able to use stdin and stdout. How can I take
advantage of this from within Axapta, so I can avoid using disk operations?
Q2) If Q1 is not possible, is there an elegant way of making Axapta wait for
the file (i.e., not checking for the file within a while loop)?
Thanks for your time.
Cheers,
Lars