Page 1 of 1
get commandline print
Posted: Tue Jan 09, 2007 11:06 pm
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
Posted: Wed Jan 10, 2007 12:52 am
by kenmo
Is ProgramParameter() what you're looking for?
Re: get commandline print
Posted: Wed Jan 10, 2007 1:21 am
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?
Posted: Wed Jan 10, 2007 1:39 am
by J. Baker
I think I need ReadProgramData(). Now I just need to figure it out.
Posted: Wed Jan 10, 2007 12:22 pm
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.

Posted: Thu Jan 11, 2007 5:26 am
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$)
Posted: Thu Jan 11, 2007 5:39 am
by J. Baker
I wonder if this has to do with WaitWindowEvent?
Posted: Thu Jan 11, 2007 9:13 am
by J. Baker
I figured it out.
the thing you want
Posted: Thu Jan 11, 2007 10:20 am
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