Michael Vogel wrote: Thu Mar 20, 2025 8:43 am
I want to write to the actual console window and 'return' to the prompt again. In the example below (needs to be compiled for console) I have to press the return key again:
Hi Michael, you don't have to press Enter again — you're already back at the Windows command input, but you don't see the command prompt. It's due to the logic of your code, because you're calling your own programme again, if you don't run it with a parameter.
1. Example with a parameter :
C:\>cons1 Hello
Main
Hurray!
C:\>
It is doing what is expected of it.
2. Again, proof that it works without a parameter
C:\>Main
Hurray!
cd <---- Entered a Windows command and it responds as expected with C:\
C:\
C:\>
You also close the console every time you write a line to it. I would remove your complicated procedures, it was not easy to see what was going on because of the Main() and Console() and ConsoleEnd().
As a test which is all that is necessary to test the claim that you need to press Enter again, the whole thing can be replaced with two lines of code.
Code: Select all
OpenConsole("Run Tool")
PrintN("Yes, working")