Commodore 128 Alive!

Commodore 128 => 128 programmers => Assembly => Topic started by: stiggity on December 13, 2010, 02:37 AM

Title: directory into array in ML..
Post by: stiggity on December 13, 2010, 02:37 AM
Anybody? Or if i open the directory channel, and perform an SYS, take each entry and store into a string? untill EOF??
Title: Re: directory into array in ML..
Post by: Payton Byrd on December 14, 2010, 06:09 AM
Quote from: stiggity on December 13, 2010, 02:37 AM
Anybody? Or if i open the directory channel, and perform an SYS, take each entry and store into a string? untill EOF??


I can tell you from experience that this is a BAD idea.  Large directories will VERY quickly eat up all your RAM.  For CBM-Command I had to limit my directory array and using a sliding window technique to display large directories.
Title: Re: directory into array in ML..
Post by: stiggity on December 14, 2010, 07:00 AM
Payton:
How about I open the directory channel, and perform an SYS that goes sequentially down the directory and returns to basic after each entry has been stored into a single string. like open1,8,0,"$0:":sysML then while back in basic,i can manipulate the created string, then when im done, and im ready for the next entry, perform another sysML... or am i trying to reinvent the wheel..?

-Steve
Title: Re: directory into array in ML..
Post by: Payton Byrd on December 14, 2010, 12:33 PM
Well, if you're only interested in working with one string at a time then why even bother with any assembler to read the string?  My initial response was based on an assumption that you wanted to put each directory entry into a string, which I assumed meant you were keeping them all at once, which would indeed be a bad idea. :)
Title: Re: directory into array in ML..
Post by: stiggity on December 21, 2010, 04:40 AM
I've searched hi/lo (heheh) for example code on storing each directory entries, into a string. If i open the directory with a

open1,8,0,"$0:filename"

what would i have to do (even in BASIC) to get "filename" entry into a string.
one that would have the block size, filename, and type.

When i said array, i had remembered having some "directory into array" BASIC 2.0 lying around, but since havn't been able to locate it. So, Payton. hehhe im sorry to
scare you with trying to array an entire directory.. if i could find an example i'd be thrilled.

WAGNER is one helluva programmer. Thanks so much for all the assistance. Without his help, i dont think i would be able to understand strings, and buffers like i do now.
EhPortal 1.34 © 2026, WebDev