[futurebasic] One last question

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2014 : Group Archive : Group : All Groups

From: Bill Tomlinson <billtomlinson@...>
Date: Mon, 09 Jun 2014 10:30:36 -0700
I  tried modifying it to make it output file instead of input. I tried to write string numbers 1-100 as a test, but then got an error message (attached). Is there some sort of minimal change that will make it work?


Include "Util_FileDirectory.incl"

dim as CFURLRef appDirURL, fileURL
dim as Str255 b
dim i%

fn FD_ApplicationDirectoryCreateCFURL( @appDirURL )	// get the URL of this app’s directory
fileURL = fn CFURLCreateCopyAppendingPathComponent( _kCFAllocatorDefault, appDirURL, @"TestData.txt", _false )	// create file URL
CFRelease( appDirURL )	// we’re done with this - release it

if ( fn FD_ObjectExistsCFURL( fileURL ) )
open "O", 1, fileURL
for i=1 to 100
b$=str$(i)
print #1, b
next i
close 1
end if

CFRelease( fileURL )	// clean up

rem RunApplicationEventLoop()


Attachments: