get commandline print

Just starting out? Need help? Post your questions and find answers here.
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

get commandline print

Post by J. Baker »

There's a program that I know prints out commandline messages from it's app. The author doesn't seem to know how to print these messages in windows. As I beleive he's mainly a linux user. Is there anyway to get these in a PB app? Thanks
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
User avatar
kenmo
Addict
Addict
Posts: 2033
Joined: Tue Dec 23, 2003 3:54 am

Post by kenmo »

Is ProgramParameter() what you're looking for?
rule
User
User
Posts: 14
Joined: Sat Sep 02, 2006 7:56 pm
Location: Oostzaan / Netherlands

Re: get commandline print

Post by rule »

J. Baker wrote:There's a program that I know prints out commandline messages from it's app. The author doesn't seem to know how to print these messages in windows. As I beleive he's mainly a linux user. Is there anyway to get these in a PB app? Thanks
Or is RunProgram() what you looking for?
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Post by J. Baker »

I think I need ReadProgramData(). Now I just need to figure it out.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Have a look in the manual under 'RunProgram()', there's a nice little example of ReadProgramString() there which I've made use of in the past.

Should get you started. :)
I may look like a mule, but I'm not a complete ass.
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Post by J. Baker »

I got it by modifying the code slightly and using #PB_Program_Connect. Is there a way to make this update faster? I'm trying to update my textgadget as it will be getting information from the other program very fast. Thanks!

Code: Select all

If Compiler  
            While ProgramRunning(Compiler)
             Output$ = ReadProgramString(Compiler) + Chr(13)
              SetGadgetText(#Link, Output$)
            Wend
              Output$ + Chr(13) + Chr(13)
            Output$ + "Exitcode: " + Str(ProgramExitCode(Compiler))     
           EndIf
             MessageRequester("Output", Output$)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Post by J. Baker »

I wonder if this has to do with WaitWindowEvent?
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Post by J. Baker »

I figured it out.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
burnix
New User
New User
Posts: 6
Joined: Wed Jan 10, 2007 2:32 pm
Location: Bordeaux

the thing you want

Post by burnix »

perhaps it's usefull for you :

Code: Select all

Enumeration
  #Editor
EndEnumeration

OpenWindow(0, 0, 0, 512, 384, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu) 
CreateGadgetList(WindowID(0)) 
TextGadget(#Editor, 10, 10, 492, 364,"",#PB_Text_Right)


Pid = RunProgram("mencoder.exe", "-endpos 20 -ffourcc XVID video.mpg -ovc xvid -xvidencopts bitrate=1000:trellis:me_quality=6:vhq=4:chroma_opt:noqpel:nogmc:autoaspect -oac mp3lame -lameopts cbr:br=96 -o out.avi", "", #PB_Program_Hide|#PB_Program_Open|#PB_Program_Read) 

Repeat 
  Select WaitWindowEvent(10) 
    Case #PB_Event_CloseWindow 
      Break 
  EndSelect 
    
    
    SetGadgetText(#Editor,ReadProgramString(Pid))

ForEver 

KillProgram(Pid) 
CloseProgram(Pid)
i works under winxp
Post Reply