💾 Archived View for mirrors.apple2.org.za › archive › ground.icaen.uiowa.edu › MiscInfo › Programmin… captured on 2023-01-29 at 10:17:51.

View Raw

More Information

-=-=-=-=-=-=-


In article <816014.ADTLOYUQ@news.telusplanet.net>, Simon Williams
<DONTemail@luddite.ca> wrote:

>Is there any way to return the results of
>PRINT CHR$(4) "VERIFY /VOLUME/"
>back to Applesoft, I'd like to avoid having my program abort
>when I forget to load the data disk... I realise I could 
>accomplish that with an ONERR routine that skips around a PATH
>NOT FOUND error, but I was wondering if there is a way to PEEK the
>value somehow...
>
>Also (as if that weren't enough), is there any way to extract
>information from CATALOG?  Ideally I'd like to be able to 
>PRINT CHR$(4) "CATALOG /VOLUME,TDIR"
>and be able to use the directory names as 


s in my basic program
>without having to enter them manually...
>
>Simon

VERIFY does a GET_FILE_INFO mli call. If it fails then Applesoft
(Basic.System really) is going to return the error. The only way to avoid
that is using ONERR. That would be the easiest way to handle any error.

The VERIFY (GET_FILE_INFO) parmlist starts at $BEB4. You can peek
information from there:

$BEB4    $0A      ;# of parms
$BEB5    $BBEF    ;address of pathname
;the following are returned by the command
$BEB7             ;access bits
$BEB8             ;file type
$BEB9             ;aux type
$BEBB             ;storage type
$BEBC             ;file - blocks used/volume - total blocks
$BEBE             ;mod date
$BEC0             ;mod time
$BEC2             ;create date
$BEC4             ;create time

to read directories from basic try:

10 d$=chr$(4)
20 print d$"open /my.volume,tdir"
30 print d$"read /my.volume"
40 input L1$:input L2$:input L3$
50 input L4$:print L4$
60 if L4{body}lt;> "" goto 50
70 print d$"close"

L1$ would be the volume or directory name 
L4$ would be file names. You can selectively print file types by parsing
the string for the file type info.

Hope this helps.

jim