[futurebasic] Re: [FB] Status: FB's File I/O statement update ( i.e. conversion to 64-bit ) still in-progress

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2017 : Group Archive : Group : All Groups

From: Brian S <fblistserve@...>
Date: Thu, 2 Mar 2017 12:03:53 -0700
> On Mar 2, 2017, at 7:47 AM, Ken Shmidheiser <kshmidheiser@...> wrote:
> 
> Brian wrote:
> 
>> Ken's URL write up the FB Help's Appendix 'A' is a good overview.
> 
> 
> 
> Brian,
> 
> The example in the Appendix is dated. This should be stronger.
> 
> Ken
> 
> 
> include "Tlbx LSOpen.incl"
> include "Tlbx CFBundle.incl"
> 
> include resources "ReadMe.txt" // file to be copied to <app>/Contents/Resources
> 
> local mode
> local fn OpenReadMe( name as CFStringRef )
> '~'1
> dim as CFBundleRef bundle
> dim as CFURLRef    url
> 
> bundle = fn CFBundleGetMainBundle()
> if ( bundle )
> url = fn CFBundleCopyResourceURL( bundle, name, 0, 0 )
> if ( url )
> fn LSOpenCFURLRef( url, NULL )
> CFRelease( url )
> end if
> end if
> end fn
> 
> fn OpenReadMe( @"ReadMe.txt" )
> 
> RunApplicationEventLoop()


Thanks Ken. This will work nicely with the revisions I've already made to Appendix A in anticipation of FB's next release. One comment if I may:

Maybe a little early for this discussion but depending on an FBer's future plans it might be more appropriate to use FB's 'HandleEvents' and not Apple's Carbon 'RunApplicationEventLoop'(RAEL). The reason is 'HandleEvents' is translated into whatever the FB runtime provides while RAEL is a toolbox call and that's what the FBer gets. 'HandleEvents' can potentially be updated to use non-Carbon but RAEL cannot.

Brian