[Coco] Basic09 & Reading files

L. Curtis Boyle curtisboyle at sasktel.net
Tue Feb 21 20:15:54 EST 2017


Theoretically from my dim memroy (and with me not able to test):

TYPE directoryentry=name:STRING[29];start(3):BYTE
DIM direntry:directoryentry
DIM dirpath:BYTE
OPEN #dirpath,”.”:READ+DIR
GET #dirpath,direntry
PRINT “Filename=“;direntry.name
CLOSE #dirpath

I should not: BASIC09 uses a NUL (CHR$(0)) as a string terminator… but the directory entries use a hi bit (CHR$(>128) instead. So you may have to do a little translation on that last character.


L. Curtis Boyle
curtisboyle at sasktel.net



> On Feb 21, 2017, at 6:58 PM, phillip taylor <ptaylor2446 at gmail.com> wrote:
> 
> You can you please provide me with me a example code without using any
> arrays?
> 
> 
> 
> On Tue, Feb 21, 2017 at 7:58 PM, phillip taylor <ptaylor2446 at gmail.com>
> wrote:
> 
>> In the type statement it's dim by 29 charectors. Since I am using a
>> emulator its hard to copy and past the code here.
>> 
>> On Tue, Feb 21, 2017 at 7:54 PM, L. Curtis Boyle <curtisboyle at sasktel.net>
>> wrote:
>> 
>>> There should be no restriction (unless you didn’t DIM the string long
>>> enough). What exact code are you using?
>>> 
>>> L. Curtis Boyle
>>> curtisboyle at sasktel.net
>>> 
>>> TRS-80 Color Computer Games website
>>> http://www.lcurtisboyle.com/nitros9/coco_game_list.html
>>> 
>>> 
>>> 
>>>> On Feb 21, 2017, at 6:39 PM, phillip taylor <ptaylor2446 at gmail.com>
>>> wrote:
>>>> 
>>>> I wrote a program in Basic09 that reads the file names from the
>>> harddrive
>>>> but its only reading the 1st 20 chars. Is there a restrictions that
>>>> prevents from reading the filename that equal up to 29 chars?
>>>> 
>>>> --
>>>> 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
> 



More information about the Coco mailing list