[futurebasic] Re: [FB] Simple examples needed

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

From: William Simon <william_simon@...>
Date: Mon, 21 Jun 2010 21:48:48 -0400
Thank you. I will try these tomorrow. Tuesday.

This is the first time i have used this help group and I am impressed  
by how helpful people like yourself are.


On Jun 21, 2010, at 6:45 PM, Robert Purves wrote:

>
> William Simon wrote:
>
>> Similarly the open instruction of FB 5 should open the file "DOG"
>> open "I",2,"/Users/williamsimon/Desktop/DOG.txt"
>> As far as I can see from the description in the FB 5.pdf  this  
>> should work. It doesn't.
>
> One reason for the commercial demise of FB was that it failed to  
> adapt to the massive changes in OS X.
> File-handling statements were stuck in obsolete MacOS 7/8/9. In  
> particular, there was no way of referring to
> - file names with Unicode characters
> - file names > 31 characters
> - OS X paths.
>
> These deficiencies are all overcome in the freeware FB5, but support  
> for paths is not as simple as you might like.
>
>> I look at the examples and they are a collection of chicken tracks,  
>> ie Mysterious OS calls that make them look pretty but  at the cost  
>> of making them very hard to read.
>
> Here's how to convert a path into an FSRef that can be used to open  
> a file for input. It uses a chicken track function named  
> FD_PathGetFSRef(). The "FD" part of the name means "FileDirectory".
>
> '-----------
> include "ConsoleWindow"
> include "Util_FileDirectory.incl"
>
> dim as FSRef   fileRef
> dim as Str255  s
>
> fn FD_PathGetFSRef( @"/Users/williamsimon/Desktop/DOG.txt", 0,  
> @fileRef )
> open "I", 1, fileRef
> while not eof( 1 )
> line input #1, s
> print s
> wend
> '-----------
>
> Robert P.
>
> --
> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
>