[futurebasic] Re: [FB] Line Input

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2016 : Group Archive : Group : All Groups

From: Brian S <fblistserve@...>
Date: Sat, 5 Nov 2016 12:19:56 -0700
> On Nov 5, 2016, at 7:53 AM, Bernie <bernie.fblist@...> wrote:
> 
> 
> Brian wrote:
> 
>> On Nov 4, 2016, at 11:02 AM, Brian S <fblistserve@...> wrote:
>>> 
>>>> Brian wrote: For Bernie’s demo you would need to use the callback ( Bernie’s outputAvailable: method passes the data to the callback ).
>>> 
>>> Apparently outputCallback is not populated ( even if sent with the original BackgroundTaskRun() call which I modified to send a function name )
>> 
>> Okay, after review,  Bernie’s code works fine and my previous assertion of outputCallback failure is entirely incorrect. My apologies for the error.
>> 
>> Change Bernie’s call from:
>> 
>> BackgroundTaskRun( command, @fn MyTaskCompletedCallback, NULL, NULL, NULL )
>> 
>> to:
>> 
>> BackgroundTaskRun( command, @fn MyTaskCompletedCallback, NULL, @fn MyTaskCompletedCallback, NULL )
>> 
>> In your own code it would be preferable to use a different callback fn for the output callback but the idea is the same. The output would be found in the ’string’ variable in that function. 
>> 
>> btw: The 'ls -a' command was used for testing since it runs on any OS X release. 
> 
> As noted earlier, suggest removing the CFRelease in the callback.
for Rich: with both the task completion and task output callback active this will crash on the second callback, so definitely remove the CFRelease() in the callback.


Brian