ProDOS Commands for Basic [message #379839] |
Fri, 18 January 2019 16:07 |
|
Originally posted by: Apple//e86
Hello,
I am refreshing my skills with Basic and ProDOS. Is there a way to load/save Basic program files from a disk drive 2? If so, what would the commands be? Thank you!
|
|
|
Re: ProDOS Commands for Basic [message #379840 is a reply to message #379839] |
Fri, 18 January 2019 16:10 |
Steve Nickolas
Messages: 2036 Registered: October 2012
Karma: 0
|
Senior Member |
|
|
On Fri, 18 Jan 2019, Apple//e86 wrote:
> Hello,
>
> I am refreshing my skills with Basic and ProDOS. Is there a way to load/save Basic program files from a disk drive 2? If so, what would the commands be? Thank you!
>
>
,D2
-uso.
|
|
|
|
|
Re: ProDOS Commands for Basic [message #379862 is a reply to message #379845] |
Fri, 18 January 2019 21:58 |
gids.rs
Messages: 1395 Registered: October 2012
Karma: 0
|
Senior Member |
|
|
,D2 should not really be used without the Slot derivitive, as Prodos can handle not only floppy drives, but 3.5 floppies, hard drives and Ram Drives all connected at the same time. All can also have a 2nd drive of each kind.
With that many drives I feel it is best not to limit a basic program to just D1 and D2, and better off to use the Prefix command.
Remember also that Prodos can handle sub-directories and is limited to only 51 files in the root directory.
You would use the Prefix command with CHR$(4) like this
10 ? CHR$(4)"PREFIX,S6,D2": INPUT VOL$
It is a little more involved to read the subdirectories and fikes from basic, but to enter a subdirectory is very easy. Just enter the subdir name after the Prefix command.
Some more examples of the Prefix command
10 ? CHR$(4)"PREFIX /VOLNAME": requires forward slash
10 ? CHR$(4)"PREFIX SUBDIRECTORYNAME"
10 ? CHR$(4)"PREFIX": INPUT VOL$: gets current slots prefix
To read files from any directory is
20 ? CHR$(4)"READ"VOL$DIR$: CT=1
30 INPUT A$: INPUT A$: INPUT A$: discard the first 3 lines of a CATALOG
40 INPUT FI$(CT): CT=CT+1
50 IF FI$(CT) <> "" THEN 40
60 CT=CT-1: FOR I =1 TO CT: ? FI$(I): NEXT
That should be enough to get you started. You will have to first read the volune name and subdirectory name into VOL$ and DIR$
|
|
|
Re: ProDOS Commands for Basic [message #380396 is a reply to message #379862] |
Wed, 30 January 2019 17:30 |
|
Originally posted by: billchatfield1
On Friday, January 18, 2019 at 9:58:14 PM UTC-5, I am Rob wrote:
> ,D2 should not really be used without the Slot derivitive, as Prodos can handle not only floppy drives, but 3.5 floppies, hard drives and Ram Drives all connected at the same time. All can also have a 2nd drive of each kind.
>
> With that many drives I feel it is best not to limit a basic program to just D1 and D2, and better off to use the Prefix command.
>
> Remember also that Prodos can handle sub-directories and is limited to only 51 files in the root directory.
>
> You would use the Prefix command with CHR$(4) like this
>
> 10 ? CHR$(4)"PREFIX,S6,D2": INPUT VOL$
>
> It is a little more involved to read the subdirectories and fikes from basic, but to enter a subdirectory is very easy. Just enter the subdir name after the Prefix command.
>
> Some more examples of the Prefix command
>
> 10 ? CHR$(4)"PREFIX /VOLNAME": requires forward slash
> 10 ? CHR$(4)"PREFIX SUBDIRECTORYNAME"
> 10 ? CHR$(4)"PREFIX": INPUT VOL$: gets current slots prefix
>
> To read files from any directory is
>
> 20 ? CHR$(4)"READ"VOL$DIR$: CT=1
> 30 INPUT A$: INPUT A$: INPUT A$: discard the first 3 lines of a CATALOG
> 40 INPUT FI$(CT): CT=CT+1
> 50 IF FI$(CT) <> "" THEN 40
> 60 CT=CT-1: FOR I =1 TO CT: ? FI$(I): NEXT
>
> That should be enough to get you started. You will have to first read the volune name and subdirectory name into VOL$ and DIR$
A big part of this is knowing what the volume names are before you type in PREFIX /VOLNAME. ProDOS does not provide a straight-forward way to get the volume names. So, I wrote a program to do it: https://github.com/gungwald/online
There is an online.dsk download in the releases section.
|
|
|