[futurebasic] Re: [FB] Opening Files from Finder

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2004 : Group Archive : Group : All Groups

From: BrucesFB3@...
Date: Tue, 7 Sep 2004 10:44:06 EDT

I meant to say, "handbook"

Yes, "Switching to FuturueBASIC," does have a lot of good stuff on
files. Some of it needs editing though.

On p. 114 of that handbook is a listing for writing sequential files
using FSSpec. Unfortunately as printed it won't run. I wrote a
correction for it (see below). I think I have it right. Please, anyone,
I welcome corrections and improvements if I made errors. FSSpec
is still quite new to me, but I am progressing.

Bruce Gottshall

On Mon Sep 6 19:38:58 2004 Scott Spencer <sj3@...> wrote:

>That will be one of the Chapters in the Handbook, but the book 
>"Switching to FuturueBASIC" has a pretty good chapter on Files.
>On Sep 6, 2004, at 1:55 PM, BrucesFB3@... wrote:
>> I believe Scott S is working on a manual for FB4. Please, Scott,
>>make it strong on file handling. I know I am out of date and
>>need to catch up.

>Scott Spencer

===p. 114 (modified) from "Switching to FuturueBASIC,"===

clear local
Dim AppFolderRef as word
dim dataFileSpec as FSSpec
dim 5 a$
dim result        as word
local fn DoSeqFiles
window 1

def open "TEXTAbcd"         // Comment OPEN "0"-- out and
open "O", 1, "Data File"     // you will get an error
close 1

AppFolderRef = system(_aplVol)

result = fn FBMakeFSSpec(AppFolderRef,0,"Data File", dataFileSpec)

long if result = _noErr

open "O",#1,@dataFileSpec

a$ = "One"   : write #1, a$;5
a$ = "Two"   : write #1, a$;5
a$ = "Three": write #1, a$;5

close #1

open "I",1,@dataFileSpec

read #1, a$;5: print a$
read #1, a$;5: print a$
read #1, a$;5: print a$

close #1

print "An Error Occurred"
print "Result =   ";result
end if
end fn

fn DoSeqFiles

until 0

To unsubscribe, send ANY message to: futurebasic-unsubscribe@...