Output of Program executed with Run() is not handled ion AmigaOS 3

Discuss any general programming issues here
Post Reply
amiga23
Posts: 33
Joined: Thu Jan 30, 2014 6:01 pm

Output of Program executed with Run() is not handled ion AmigaOS 3

Post by amiga23 »

Output of a program executed on AmigaOS3 with Run() does not call the RunOutput event handler.

Code: Select all

Function p_printoutput(msg)
	ConsolePrint("\n---printoutput---")
	ConsolePrint(msg.Output)
EndFunction

Function p_printreturncode(msg)
	;ForEach(msg, DebugPrint)
	ConsolePrint("\n---printreturncode---\nReturnCode:",msg.ReturnCode)
EndFunction

InstallEventHandler({RunOutput=p_printoutput, RunFinished=p_printreturncode})
Run("C:Type", "S:Startup-sequence",{ReturnCode=True})
Repeat
	WaitEvent()
Forever
Code example "borowed" from here: viewtopic.php?p=19653#p19653

If I do not install a RunOutput EventHandler, the output is displayed on the terminal I start the program from. If I do install the RunOutput EventHandler, the output is not printed to the terminal and the RunOutput EventHandler p_printoutput is not called.

Tested on AmigaOS 3.2.2.1 with Hollywood 10.0 run from AmigaShell and from CubicIDE.

Works fine on GNU/Linux (Tested on latest Manjaro with Hollywood 10.0)

Thank you very much for the improvements you already made to the Run() function.
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Output of Program executed with Run() is not handled ion AmigaOS 3

Post by airsoftsoftwair »

Yes, I can confirm this even though it's surprising me. I surely tested this on OS3 when I first implemented it. Must have got broken when I made some changes to the code later. Thanks for reporting!
Post Reply