[futurebasic] Re: [FB] Sheet window problems

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

From: Brian S <fblistserve@...>
Date: Wed, 30 Nov 2016 12:44:49 -0700
> On Nov 30, 2016, at 10:08 AM, Peter Boyle <paboyle1703@...> wrote:
> Thanks Bernie, already figured that one out, but it is real clumsy 

Maybe a called function reduces the clumsiness. Obviously would be better to use the CFString from the record directly but maybe this cleans up your edit field calls.

begin record SomeRecordType
dim as CFStringRef gCostPd
end record

begin globals
dim as SomeRecordType gPref
end globals

local fn CFStringFromCFString( cfString as CFStringRef ) as CFStringRef
 CFStringRef s = (CFStringRef)[(NSString *)cfString copy];
[(NSString *)s autorelease];
return s;
end fn = NULL

dim as Rect r
edit field 1, fn CFStringFromCFString( gPref.gCostPd ), @r, _statNoFramed