![]() |
Forum Index : Microcontroller and PC projects : PicoMite file handling in mmbasic
Author | Message | ||||
JLewis Newbie ![]() Joined: 14/06/2022 Location: United KingdomPosts: 4 |
Firstly, I just want to say hi! I'm done with lurking in the forums and just got my PicoMite VGA up and running yesterday. The last time I programmed in BASIC was around 25 years ago with AMOS on the Commodore Amiga, so needless to say, I'm a little rusty! Whilst feeling waves of nostalgia, I converted a load of cool Sinclair ZX Spectrum artwork into RGB 1-2-1 bitmaps to see how they look on the PicoMite VGA - surprisingly good, I have to say. I decided I'd program a simple slideshow to show them off... I dumped a ton of bitmaps with descriptive filenames into a folder on the SD card, thinking I'd be able to get the Pico to check the folder and automatically load each image one by one. And that's as far as I have got! Precisely nowhere lol. I thought that I would be able to scan the entire folder, then store the filenames, for example into an array, rather than explicitly name each one in the program. I don't know which command to use. Please could somebody point me in the right direction? Regards Jamie Ps. I was going to ask about how to achieve indexed colours yesterday but spotted a nice example in somebody's Mandelbrot demo ![]() |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
Hi Jamie, Welcome onboard. Sounds like you want the DIR$() function. Best wishes, Tom Edited 2022-06-16 06:14 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
Need more help? This (or something similar) should do the trick, a simple example: CONST MAXFILES=100 DIM f$(MAXFILES) ' each string takes 255 Bytes! DIM i as integer i=1 f$(i) = LCase$(Dir$("*.*", FILE)) Do While f$(i) <> "" And i<MAXFILES i=i+1 f$(i) = LCase$(Dir$()) 'PRINT f$(i) Loop ' You can add a string sort if you want Best regards Michael causality ≠ correlation ≠ coincidence |
||||
JLewis Newbie ![]() Joined: 14/06/2022 Location: United KingdomPosts: 4 |
Oops! Feel a bit silly now. I completely missed the DIR$ function ![]() Thanks for the heads up guys ![]() |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |