Path: utzoo!attcan!uunet!lll-winken!ames!xanth!nic.MR.NET!csd4.milw.wisc.edu!bbn!rochester!pt.cs.cmu.edu!cadre!pitt!cisunx!erast1 From: erast1@cisunx.UUCP (Evan Ron Aussenberg) Newsgroups: comp.sys.apple Subject: Re: Getting a CATALOG into a file (semiLONG) Message-ID: <15354@cisunx.UUCP> Date: 27 Jan 89 05:33:09 GMT References: <8901251315.aa00307@SMOKE.BRL.MIL> Reply-To: erast1@unix.cis.pittsburgh.edu (Evan Ron Aussenberg) Organization: The Zets Lines: 57 In article <8901251315.aa00307@SMOKE.BRL.MIL> ART100@PSUVM.BITNET ("Andy Tefft 862-6728", 814) writes: >Well, I haven't tried this out, but you DO have to use > >PRINT CHR$(4)"CATALOG" > >instead of using just CATALOG, as you do with all DOS 3.3 or ProDOS commands >in programs. > >You can also read the directory in as a binary file, > >BLOAD dirname,A$addr,TDIR (of course this assumes you entered it from > the keyboard; don't forget the ?CHR$(4)!) > >and then try to decode the information from that... C'mon now... lets make things easier than that. I haven't used AppleSoft in a long time but I remember something like the following should work. 100 d$=chr$(4) 102 fi$ = "Your.catalog" 105 : 110 print d$"prefix": input p$: REM: Optional, get the current prefix 120 print 125 print "This is the directory of "; 130 inverse: print p$;: normal: print 140 : 150 print d$"open "p$",TDIR" 160 for x=1 to 3: gosub 500: gosub 600: next: REM: input the headers 162 REM: of the catalog. 165 gosub 500: gosub 600: REM - Keep inputing lines as long 170 if len(dir$) > 0 then 165: REM - as they aren't blank. 175 : 180 gosub 500: gosub 600: REM - get the last line 185 : 190 print d$"close" 200 END 300 : 400 REM --------------------------------------------------------------- 450 : 480 : 500 print d$"read "p$ REM - A subroutine to read a catalog line 502 input dir$: print dir$ 505 RETURN 510 : 600 print d$"write "fi$ REM - A subr. to send a catalog to a file 605 print dir$ 610 RETURN Hope this works... any errors are free of charge. Evan Ron Aussenberg - erast1@unix.cis.pittsburgh.edu PS - One final note. If you're prefixing /ram get rid of line 180, for some reason (someone more technical than I am can say...), I can't seem to read the 'BLOCKS FREE' line from there. I haven't tried it on /ram5 with my GS though, so I don't know if it's a problem just with /ram or with RAM disks in general. Could never figure that one out...