directory into array in ML..

Started by stiggity, December 13, 2010, 02:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stiggity

Anybody? Or if i open the directory channel, and perform an SYS, take each entry and store into a string? untill EOF??

Payton Byrd

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.
Payton Byrd
---------------------------------------------------
Flat 128 w/JD, uIEC/SD, uIEC-CF/IDE,
1541 Ultimate, 1571 w/JD, 1581 w/JD,
VDC-SVideo, Visio 19" HDTV

stiggity

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

Payton Byrd

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. :)
Payton Byrd
---------------------------------------------------
Flat 128 w/JD, uIEC/SD, uIEC-CF/IDE,
1541 Ultimate, 1571 w/JD, 1581 w/JD,
VDC-SVideo, Visio 19" HDTV

stiggity

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.