SEWALL@UCONNVM.BITNET (07/13/87)
A few weeks ago, you asked for an Applesoft routine to capture DOS 3.3 file names into an array. I sent you one that uses an embedded machine language routine to do the job. That program works very nicely, but it does have one weakness - an Applesoft compiler won't be able to digest it. Thanks to Bill Parker, here is an alternative which has no internal machine code (EXEC this under DOS 3.3). -----------------------Cut Here-------------------------------- NEW 10 REM CAT SCAN BY BILL PARKER FROM CALL-A.P.P.L.E. JUNE '87, PAGE 58 15 REM TO MAKE INTO SUBROUTINE CHANGE 'END' TO 'RETURN' IN 160 AND 17 REM MOVE DIM STATEMENT IN 100 TO BEGINNING OF PROGRAM 20 REM RETURNS WITH ALL DOS 3.3 FILE NAMES IN ARRAY NAME$ 30 REM THE NUMBER OF FILE NAMES IS RETURNED IN 'N' 40 REM CONTAINS NO MACHINE CODE (NICE FOR COMPILERS) 50 REM 100 DIM NAME$(105): REM MAX NUM OF DOS 3.3 FILE NAMES 110 N1 = 46278: REM 1ST NAME IN BUFFER 120 N7 = 46488: REM LAST NAME IN BUFFER (7 NAMES MAX) 130 N = 0: REM NUM OF FILE NAMES READ 140 BUFPTR = N1: REM PTR TO BUFFER 150 CALL 45073: REM READ 1ST 7 FILE NAMES INTO BUFFER 155 REM 160 IF PEEK(BUFPTR) = 0 THEN END: REM NO MORE FILE NAMES 170 IF PEEK(BUFPTR) = 255 THEN 220: REM SKIP DELETED FILE 180 N = N + 1: REM COUNT VALID FILE NAME 190 FOR I = BUFPTR+3 TO BUFPTR+32 200 NAME$(N) = NAME$(N) + CHR$(PEEK(I)): REM STORE FILE NAME 210 NEXT I 220 BUFPTR = BUFPTR + 35: REM POINT TO NEXT FILE NAME 230 REM IF ALL 7 NAMES HAVE BEEN EXTRACTED, LOAD NEXT 7 AND CONTINUE 240 IF BUFPTR > N7 THEN CALL 45088: BUFPTR = N1 250 GO TO 160 SAVE CAT SCAN