RunProgramConPTY (windows only)

Share your advanced PureBasic knowledge/code with the community.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5709
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: RunProgramConsole (windows only)

Post by Kwai chang caine »

Aaaah ok !!!! :oops: Thanks 8)

Before i just know the Debug window..and live happy with her hand in the hand during decade 8)
But now..i'm really lost with all this windows and exe outside, i discover :oops: (Debug window, CallStack window,watch window, issue window, Debugger.exe, pbcompiler.exe, PureBasic_CompilationX.exe, etc ...) :shock:

Image
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5709
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: RunProgramConsole (windows only)

Post by Kwai chang caine »

I also wanted to know if this new super code replaces the other old one and amazing you had written

viewtopic.php?p=579279#p579279

, or if they work completely differently and can both be used depending on the situation.
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
infratec
Always Here
Always Here
Posts: 7835
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: RunProgramConsole (windows only)

Post by infratec »

They are different :wink:

RunProgram( ) connects stdin, stdout and stderr to the program you are starting.
RunProgramConsole() connects stdin and stdout to the PseudoConsole (ConPTTY).

But you can do the same things with it. But there is no stderr available, but this has no effect for catching the output,
since stderr also appears on the console screen.

You should be able to replace RunProgram() with RunProgramConsole()
infratec
Always Here
Always Here
Posts: 7835
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: RunProgramConPTY (windows only)

Post by infratec »

Sorry for the trouble:

I renamed the whole stuff to RunProgramConPTY and also removed the helper procedure RemoveANSIEscapeCodes() in a separate file.
This makes more sense.
Axolotl
Addict
Addict
Posts: 945
Joined: Wed Dec 31, 2008 3:36 pm

Re: RunProgramConPTY (windows only)

Post by Axolotl »

Thanks infratec
You answered my question, now I understand.
Command Prompt vs. RunProgram Output
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5709
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: RunProgramConPTY (windows only)

Post by Kwai chang caine »

Master wrote:Sorry for the trouble:
You're kidding :shock: , I'm the one who should apologize for being so hopeless and never understanding anything, or being the last to understand. :oops:
It was like this throughout my entire school career... I made my friends laugh because I was always behind everyone else. :lol:
If I was lucky, I'd understand the first lesson when the teacher was on the third, and even then I was glad because often, I didn't understand it at all, and understanding the following ones... it was even worse. :|

Thanks a lot for have renaming and clarified the subject :wink:
I believe... :mrgreen: that i have understand this time :shock:

In all case...i keep your two splendids codes, which are too valuable in my eyes, since I love controlling all external applications and PCs via the network, i found that "MAGICAL" :shock:
The next time I come across a black rectangle that writes to me :mrgreen: , I'll try each and every one of the lovely codes you were kind enough to create 8) it would be a miracle if even one could resist the grand master INFRATEC :?
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
Post Reply