Jump to content

Recommended Posts

Okay here is a Directory program you can type and run from BASIC or XB.

I suggest using a file name of "DIR" or "!DIR".  The second one usually keeps it at the top of your listings.

 

100 CALL CLEAR
110 INPUT "DISK DRIVE (1-3):":D
120 D=INT(D)
130 IF(D<1)+(D>3)THEN 110
140 OPEN #1:"DSK"&STR$(D)&".",INPUT ,RELATIVE,INTERNAL
150 INPUT #1:A$,FT,FS,RL
160 DISPLAY :"DSK";STR$(D);".";A$;
170 DISPLAY TAB(17);"SEC:";TAB(21);SEG$("    ",1,4-LEN(STR$(FS+2)))&STR$(FS+2)
180 DISPLAY :"AVAILABLE:";STR$(RL);TAB(17);"USED:";STR$(FS-RL)
190 DISPLAY :"FILENAME   SIZE TYPE   P":"---------- ---- ------ -";
200 INPUT #1:A$,FT,FS,RL
210 IF LEN(A$)=0 THEN 290
220 DISPLAY :A$;TAB(12);SEG$("    ",1,4-LEN(STR$(FS)))&STR$(FS);
230 DISPLAY TAB(17);SEG$("D/FD/VI/FI/VPGM",(ABS(FT)-1)*3+1,3);
240 IF ABS(FT)=5 THEN 260
250 DISPLAY SEG$("   ",1,3-LEN(STR$(RL)))&STR$(RL);
260 IF FT>0 THEN 200
270 DISPLAY TAB(24);"Y";
280 GOTO 200
290 CLOSE #1

300 END

 

 

Line 170 and 220 have 4 spaces between the quotes in the SEG$.

Line 190 has 10 minuses, space, 4 minuses, space, 6 minuses, space, and 1 minus in the DISPLAY.

Line 250 has 3 spaces between the quotes in the SEG$.

 

... enjoy ...

  • Like 5
Link to comment
https://forums.atariage.com/topic/359289-yet-another-diretory-program-for-basxb/
Share on other sites

"D/FD/VI/FI/VPGM"

 

What do your file type acronyms mean?  Is D "DISPLAY VARIABLE" ?  And why is there a V on VPGM? 

 

Mostly just curious... Everyone comes at this machine from a different perspective.

 

There is an additional file type not covered here, but since this is restricted to DSK1-3, we don't kneed to worry about sub-directories.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...