LoginLogin

3DS OS Developer Forums

Root / Talk About Programs / [.]

andritolionCreated:
3DS OS Developer Forums Please submit some ideas or bug reports (So far, bugless!) to help improve 3DS OS. See 3DS OS on http://smilebasicsource.com/page?pid=516

Umm. I think your post broke

Can someone help me make a file explorer?

FILES 'displays a list of files
FILES "//" 'displays a list of projects
FILES "EXAMPLE/" 'displays all the files in the project "example"
variable=CHKFILE(name$) 'check if a file exists (must have DAT: or TXT: at the start of the name)

More advanced usage of FILES:
DIM FILEARRAY$[0] 'create array

FILES FILEARRAY$ 'fill the array with filenames

'then you can use a FOR loop or something to display them:
FOR I=0 TO 10 'print first 10 files (example)
 PRINT FILEARRAY$[I]
NEXT

More advanced usage of FILES:
FOR I=0 TO LEN(FILEARRAY$)-1
 IF FILEARRAY$[I]!="whatever you called the OS file" THEN PRINT FILEARRAY$[I]
NEXT

I'll bring up a simple file explorer
DIM FLS$[0]
FILES FLS$
WHILE TRUE
WHILE I<LEN(FLS$)
LOCATE  1,I:?FLS$[I]
LOCATE 0,I
IF I==SEL THEN ?"*";
INC I:WEND
IF BUTTON(2)AND #DOWN THEN SEL=MIN(SEL+1,LEN(FLS$)-1)
IF BUTTON(2)AND #UP THEN SEL=MAX(SEL-1,0)
WEND

A file explorer I made a while back: http://smilebasicsource.com/page?pid=174

Entering anything in the file explorer with a "*" crashes 3DS OS.

Entering anything in the file explorer with a "*" crashes 3DS OS.
Seems he doesn't have some sort of input validation.