OS/2, eCS & ArcaOS - Technical > Programming

MeShell and PAUSE in a cmd file

<< < (2/4) > >>

Laurence Pithie:
While there's no output to stdout until the eol is recieved the cursor position will have changed. Calling VioGetCurPos before issuing a command, check for output on stdout, and if there is no output call VioGetCurPos again and compare the two values. If the values differ then use VioReadCharStr with the two values you have for the cursor position to get the output prompt and display it to the user. It's similar to the logic you used for capturing Vio Output.

Martin Vieregg:
Laurence,
but the VIO window rests empty. The cursor in the VIO window does not change. I could handle it if it is VIO output and input. But I do not receive redirected stdout in the described case. I thaught that the Vio* calls are completely restricted to the VIO window and not to stdin/stdout ?

Laurence Pithie:
The standard i/o functions move the Vio cursor. I've attached a simple program, with source, to demonstrate.

Laurence Pithie:

--- Quote ---But I do not receive redirected stdout in the described case
--- End quote ---
You need to check for the change in the cursor position in the child/helper application, then use VioReadCharStr to get the prompt text and send that text through the pipe to the main application.

Martin Vieregg:
Thank you for the sample. Sorry, but it does not. You forgot that stdout is piped to the editor.


--- Code: ---[H:\cursor]cursorpos
Hello World!
Initial cursor position: Column 0, Row 24
Final cursor position: Column 12, Row 24

[H:\cursor]cursorpos >out.txt

[H:\cursor]type out.txt
Hello World!
Initial cursor position: Column 0, Row 24
Final cursor position: Column 0, Row 24
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version