[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: output redirection



David Empson <dempson@actrix.gen.nz> wrote:
> Under ProDOS, the best way to achieve this is to OPEN and READ the
> directory, then OPEN and WRITE a text file, alternating between reading
> a line from the catalog and writing a line to the text file (or read
> into an array, then write the whole array to the text file).
>
> Under DOS 3.3, the only moderately straightforward way of capturing the
> catalog output is to PEEK it off the screen, or capture the text output
> via a machine code subroutine (in conjunction with a patch to prevent
> the catalog output pausing at the end of each screen).
>
>
> This is an example of the method under ProDOS.
>
> In effect, reading the catalog gives you a mirror image of the catalog
> as it would normally be displayed in 80-column mode, except that one of
> the blank lines normally displayed at the top of the catalog is missing.
> I forget whether it is the one between the pathname and title line or
> the one between the title line and the first file line - the following
> code assumes the catalog title follows immediately after the pathname
> line.  (If I got it wrong, then swap lines 70 and 80.)
>
> Note that you don't need to use PR#3, because reading the catalog with
> this method will always give you an 80-column catalog listing.
>
> 10 d$=chr$(4): f$="/pathname/of/folder": t$="catalog.txt"
> 20 print d$;"open ";f$;",tdir"
> 30 print d$;"create ";t$;",ttxt"
> 40 print d$;"open ";t$
> 50 print d$;"read ";f$
> 60 input a$: rem pathname
> 70 input c$: rem catalog title
> 80 input b$: rem blank line - discarded
> 90 print d$;"write ";t$
> 100 print a$: print: print c$: print
> 110 print d$;"read ";f$
> 120 dim l$(50)
> 130 n = 0
> 140 input l$: rem file line
> 150 if l$ = "" then goto 200: rem no more file lines
> 160 l$(n) = l$
> 170 n = n + 1
> 180 if n <= 50 then goto 140
> 190 gosub 500: goto 130
> 200 if n > 0 then gosub 500
> 210 input s$: rem summary line
> 220 print d$;"write ";t$
> 230 print: print s$
> 240 print d$;"close"
> 250 end
> 500 rem Flush the array
> 510 print d$;"write ";t$
> 520 for i = 0 to n: print l$(i): next
> 530 print d$;"read ";f$
> 540 return

David,
Thank you for this ProDOS AppleSoft program.  I will type it in and test
it out.  As long as I get output written to a file, that is perfect for
me, as I can easily send it to my other computers.  Redirecting output
direct to my SSC would be nice too, but maybe sending it to a file is
better :)  I wonder if there were any utility program(s) written for the
Apple II that would do something like this?
Anyway, thanks again.

P.S.  I was able to dial into my ISP briefly yesterday (Tuesday
actually) but didn't check usenet; only until about an hour ago was I able
to log into an ISP I normally don't use.  A lot of phone circuits are busy
here in the NYC area.  Yes I do live in NY, and I am fine, however it
looks like I am off from work again tomorrow, returning to work Friday, or
even Monday.  I work a few blocks from the WTC.  What a horrid despicable
tragedy!!

-- 
William D. Katz "a good skier"

Internet: druid@dorsai.org
Internet: wkatz@nyx.net