| www.retrosoftware.co.uk http://www.retrosoftware.co.uk/forum/ |
|
| DFS test in BASIC http://www.retrosoftware.co.uk/forum/viewtopic.php?f=73&t=633 |
Page 1 of 1 |
| Author: | Samwise [ Sat Jun 18, 2011 11:45 pm ] |
| Post subject: | DFS test in BASIC |
Hi, Is there a simple test I can use in BASIC to determine whether a DFS is present without using PAGE? Sam. |
|
| Author: | Samwise [ Sun Jun 19, 2011 2:47 am ] |
| Post subject: | Re: DFS test in BASIC |
Actually, it doesn't look like I need this anyway. Though it be handy to know anyway if anyone has any ideas? Sam. |
|
| Author: | Samwise [ Sun Jun 19, 2011 10:33 am ] |
| Post subject: | Re: DFS test in BASIC |
I woke up with the obvious idea of using ON ERROR. Must remember to sleep on it next time! Sam. |
|
| Author: | Samwise [ Sun Jun 19, 2011 12:32 pm ] |
| Post subject: | Re: DFS test in BASIC |
hmm ... actually that doesn't quite do what I want. That'll tell me if a DFS is present but not whether it's the currently selected filing system which I think is what I'm really after. Is there a memory location I can query which will tell me? Sam. |
|
| Author: | PaulDv [ Sun Jun 19, 2011 1:02 pm ] |
| Post subject: | Re: DFS test in BASIC |
OSARGS 0,0 will do that... Code: A%=0:Y%=0:FS%=USR&FFDA AND&FF FS% now contains the current file system. See here for a list of values http://beebwiki.jonripley.com/OSARGS |
|
| Author: | PaulA [ Sun Jun 19, 2011 1:05 pm ] |
| Post subject: | Re: DFS test in BASIC |
blast typed too slow. Anyway 'A' will then return the current filing system, figured you might be using machine code. |
|
| Author: | Samwise [ Sun Jun 19, 2011 2:15 pm ] |
| Post subject: | Re: DFS test in BASIC |
Thanks, Pauls! PaulDv's code is exactly what I was looking for. It's going in a BASIC menu, so that fits the bill perfectly. Sam. |
|
| Author: | jgharston [ Mon Aug 08, 2011 3:18 am ] |
| Post subject: | Re: DFS test in BASIC |
Samwise wrote: PaulDv's code is exactly what I was looking for. It's going in a BASIC menu, so that fits the bill perfectly. You shouldn't unnessessarily restrict your program's functionality when it's running on DFS unless it's absolutely neccessary. Especially, don't make your program jump through complicated hoops for DFS when non-specific filing systems calls do the job just as well. I've seen abominations of code that effectively do:IF (NOT DFS) THEN use API to read directory ELSE VDU 21, *CAT, VDU 6, peek memory when the correct code is just... use API to read directory. Also, as some filing systems that respond with fs=4 have more functionality than Acorn DFS (eg HDFS, WatfordDFS), and some filing systems that respond with fs<>4 actually have the same functionality as DFS (eg RetroRAMFS), in some cases a better test is: dfs%=FNfile("$",5)<>2. See the Wiki article. (PS: Is there any way to get inline code in the above paragraph, not having appear as a seperate paragraph?) |
|
| Page 1 of 1 | All times are UTC [ DST ] |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|