[futurebasic] Re: [FB] CFStringRef vs. string problem

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2010 : Group Archive : Group : All Groups

From: Bernie <fblist.bw@...>
Date: Tue, 14 Dec 2010 14:21:41 +0000
Eugen wrote:

> I have a little problem when I transform string to CFStringRef :
> '------------------------------
> DIM AS str255 Time
> DIM AS CFStringRef TimeCF
> 
> Time = "00:30:25"      'it's a computation variable
> TimeCF = @Time
> 
> PRINT fn HIViewSetText( button&( 1 ), @"00:30:25" ) '--> 00:30:25
> 
> PRINT fn HIViewSetText( button&( 1 ), TimeCF )
> 'or												--> ERROR and "Application quit unexpectedly"
> PRINT fn HIViewSetText( button&( 1 ), @Time )
> '------------------------------

'@' can't be used like that for CFStrings. It must always be followed by a string literal. This should work:

TimeCF = @"00:30:25"

Bernie