[Coco] Cross Post from FB Page..Disk Basic Programming Question...

Steve Batson steve_batson at yahoo.com
Thu Aug 6 19:00:06 EDT 2015


Actually, let me update my statement. This will allow me to do some of the things I have in mind, but not all. There are some things that I will still need to redirect output from the screen to a file that the basic program shown will not do :(



On Aug 6, 2015, at 3:55 PM, Steve Batson via Coco <coco at maltedmedia.com> wrote:

> Changing the 5 to 2 in lines 10,20 and 50 allowed it to write the file and makes sense looking at some info for the Disk System.
> 
> I got this working and I think this sets the stage for several of the things I have in mind. Thanks!!
> 
> 
> On Aug 6, 2015, at 3:33 PM, Christopher R. Hawks <chawks at dls.net> wrote:
> 
>> On Thu, 6 Aug 2015 15:20:30 -0700
>> Steve Batson via Coco <coco at maltedmedia.com> wrote:
>> 
>>> Changing the "I" to "O" in line ten makes sense, but that line
>>> produces a DN Error. :/
>> 
>> 	My DECB is really rusty, but, I think the open command
>> should be:
>> 10 OPEN "I",#5,"DIRFILE.TXT"
>> 
>> Like the close command is...
>> 
>>> On Aug 6, 2015, at 3:07 PM, Arthur Flexser <flexser at fiu.edu> wrote:
>>> 
>>>> Should be OPEN "O" (output) not "I".
>>>> 
>>>> Art
>>>> 
>>>> On Thu, Aug 6, 2015 at 6:06 PM, Arthur Flexser <flexser at fiu.edu>
>>>> wrote:
>>>> 
>>>>> It would be something like
>>>>> 
>>>>> 10 OPEN "I",5,"DIRFILE.TXT"
>>>>> 20 POKE &H6F,5
>>>>> 30 DIR 1
>>>>> 40 POKE&H6F,0
>>>>> 50 CLOSE #5
>>>>> 
>>>>> Art
>>>>> 
>>>>> 
>>>>> On Thu, Aug 6, 2015 at 5:59 PM, Steve Batson via Coco <
>>>>> coco at maltedmedia.com> wrote:
>>>>> 
>>>>>> Art,
>>>>>> 
>>>>>> Can you show a simple example of this?
>>>>>> 
>>>>>> Here’s a psuedo code for what I would want to do.
>>>>>> 
>>>>>> 10 Turn On Redirection of screen text to array/file
>>>>>> 20 DIR 1
>>>>>> 30 Turn Off Redirection
>>>>>> 40 Parse captured data
>>>>>> 50 Selectively Display the parsed data in new format
>>>>>> 
>>>>>> My interest is Lines 10-30, I can figure out the parsing and
>>>>>> display of parsed data. Also please don't direct me to basic
>>>>>> commands for directly reading the disk by tracks and sectors. I
>>>>>> understand how to do that but it won't do what I'm looking for
>>>>>> and I may want to use this for things beyond DIR listings.
>>>>>> On Aug 6, 2015, at 2:49 PM, Arthur Flexser <flexser at fiu.edu>
>>>>>> wrote:
>>>>>> 
>>>>>>> You could try opening the disk file with a certain device number
>>>>>> assigned
>>>>>>> to it and then poke that device number into location $6F
>>>>>>> immediately
>>>>>> before
>>>>>>> doing the LLIST or DIR (restoring the device number to zero
>>>>>>> afterwards)
>>>>>> and
>>>>>>> see if that works for getting the output into the disk file.
>>>>>>> 
>>>>>>> Art
>>>>>>> 
>>>>>>> On Thu, Aug 6, 2015 at 5:35 PM, Steve Batson via Coco <
>>>>>> coco at maltedmedia.com>
>>>>>>> wrote:
>>>>>>> 
>>>>>>>> 
>>>>>>>> Art,
>>>>>>>> 
>>>>>>>> I was asked for clarification of my question on the FB page and
>>>>>>>> your question confirms I was not very clear.
>>>>>>>> 
>>>>>>>> I want to be able programmatically start capturing anything
>>>>>>>> that is
>>>>>> going
>>>>>>>> to the screen to a file. My interest is only text, so no worry
>>>>>>>> about
>>>>>> about
>>>>>>>> graphics. So lets say I wanted my program to do a DIR or LIST
>>>>>>>> command,
>>>>>> I'd
>>>>>>>> like send all of the screen output from those commands to a
>>>>>>>> file. If
>>>>>> not a
>>>>>>>> a file, to an array (which probably is the better approach
>>>>>>>> since the
>>>>>> data
>>>>>>>> could be parsed and cleaned up before storing in a file). I'd
>>>>>>>> take
>>>>>> either.
>>>>>>>> Does this make sense?
>>>>>>>> 
>>>>>>>> To add to that, I'd want to have this work in standard Disk
>>>>>>>> Basic including Assembly if necessary. I would want to portable
>>>>>>>> between CoCo
>>>>>> so
>>>>>>>> I'm not having to worry about ADOS or other custom dos
>>>>>>>> installed.
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Aug 6, 2015, at 2:12 PM, Arthur Flexser <flexser at fiu.edu>
>>>>>>>> wrote:
>>>>>>>> 
>>>>>>>>> Do you mean something like a log file that contains both what
>>>>>>>>> you
>>>>>> type to
>>>>>>>>> the CoCo and whatever the CoCo puts on the screen in response?
>>>>>>>>> 
>>>>>>>>> I don't think there's an easy way to do that from Basic,
>>>>>>>>> though it shouldn't be too difficult to do with an assembly
>>>>>>>>> language patch to
>>>>>>>> Basic.
>>>>>>>>> You'd want to change the unit number of where the output is
>>>>>>>>> going from
>>>>>>>> unit
>>>>>>>>> #0 (the screen) to the one you've assigned to the disk file.
>>>>>> Actually, a
>>>>>>>>> simple redirect like that would prevent the output from going
>>>>>>>>> to the screen, so you'd probably want to output an additional
>>>>>>>>> copy to the
>>>>>> disk
>>>>>>>>> file of whatever is sent to the screen.
>>>>>>>>> 
>>>>>>>>> There's a feature similar to this in ADOS (the PRT ON/PRT OFF
>>>>>> command),
>>>>>>>>> except that it sends everything to the printer instead of to a
>>>>>>>>> disk
>>>>>> file.
>>>>>>>>> If that would do for your purposes, you could download ADOS
>>>>>>>>> (ADOS-3
>>>>>> for
>>>>>>>> the
>>>>>>>>> CoCo 3) and boot it up from disk.
>>>>>>>>> 
>>>>>>>>> Art
>>>>>>>>> 
>>>>>>>>> On Thu, Aug 6, 2015 at 4:12 PM, Steve Batson via Coco <
>>>>>>>> coco at maltedmedia.com>
>>>>>>>>> wrote:
>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> CoCo Disk BASIC programming question.
>>>>>>>>>> Is there a simple way in Disk BASIC to open a disk file and
>>>>>>>>>> then send anything following that command to a Disk File or
>>>>>>>>>> an Array from the
>>>>>>>> screen
>>>>>>>>>> and then stop once the data has been collected?
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> --
>>>>>>>>>> Coco mailing list
>>>>>>>>>> Coco at maltedmedia.com
>>>>>>>>>> https://pairlist5.pair.net/mailman/listinfo/coco
>>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> --
>>>>>>>>> Coco mailing list
>>>>>>>>> Coco at maltedmedia.com
>>>>>>>>> https://pairlist5.pair.net/mailman/listinfo/coco
>>>>>>>> I want to be able programmatically start capturing anything
>>>>>>>> that is
>>>>>> going
>>>>>>>> to the screen to a file. My interest is only text, so no worry
>>>>>>>> about
>>>>>> about
>>>>>>>> graphics. So lets say I wanted my program to do a DIR or LIST
>>>>>>>> command,
>>>>>> I'd
>>>>>>>> like send all of the screen output from those commands to a
>>>>>>>> file. If
>>>>>> not a
>>>>>>>> a file, to an array (which probably is the better approach
>>>>>>>> since the
>>>>>> data
>>>>>>>> could be parsed and cleaned up before storing in a file). I'd
>>>>>>>> take
>>>>>> either.
>>>>>>>> Does this make sense?
>>>>>>>> 
>>>>>>>> --
>>>>>>>> Coco mailing list
>>>>>>>> Coco at maltedmedia.com
>>>>>>>> https://pairlist5.pair.net/mailman/listinfo/coco
>>>>>>>> 
>>>>>>> 
>>>>>>> --
>>>>>>> Coco mailing list
>>>>>>> Coco at maltedmedia.com
>>>>>>> https://pairlist5.pair.net/mailman/listinfo/coco
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Coco mailing list
>>>>>> Coco at maltedmedia.com
>>>>>> https://pairlist5.pair.net/mailman/listinfo/coco
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> -- 
>>>> Coco mailing list
>>>> Coco at maltedmedia.com
>>>> https://pairlist5.pair.net/mailman/listinfo/coco
>>> 
>>> 
>> 
>> 
>> 
>> 
>> Christopher R. Hawks
>> HAWKSoft
>> -- 
>> Why can they never grasp the obvious?  Why do they have to generate
>> bizarre failure-conspiracy-theories involving the Illuminati, the cheese
>> sandwich they had for lunch last week and the phase of the moon?
>> 		-- Chris Richardson
>> ----------------------------------------
>>      \   ^__^                         
>>       \  (oo)\_______                 
>>          (__)\       )\/\           
>>              ||----w |                
>>              ||     ||                
>> 
>> -- 
>> Coco mailing list
>> Coco at maltedmedia.com
>> https://pairlist5.pair.net/mailman/listinfo/coco
> 
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco



More information about the Coco mailing list