Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:41 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PicoMite file handling in mmbasic

Author Message
JLewis
Newbie

Joined: 14/06/2022
Location: United Kingdom
Posts: 4
Posted: 07:15pm 15 Jun 2022
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4311
Posted: 08:14pm 15 Jun 2022
Copy link to clipboard 
Print this post

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: Germany
Posts: 1593
Posted: 08:58pm 15 Jun 2022
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4
Posted: 08:49am 16 Jun 2022
Copy link to clipboard 
Print this post

Oops! Feel a bit silly now. I completely missed the DIR$ function  

Thanks for the heads up guys  
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025