How do you count and list files?

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
715
How do I save my levels on desktop targets?
I want to read the complete folder to count and list all the levels inside the folder beside my executable?

How do you do it on Android? and where would the files go there is no executable file? Can i have my levels on the sdcard? I want them loose somehow not tucked inside the apk.

If that's impossible, the desktop is still possible right?
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,042
How do I save my levels on desktop targets?
SaveString, FileStream and DataBuffer come to my mind.

I want to read the complete folder to count and list all the levels inside the folder beside my executable?

Did you discover the LoadDir command? Preferable from the BRL.FileSystem module.

And resource paths, I am sure you saw that already


How do you do it on Android? and where would the files go there is no executable file? Can i have my levels on the sdcard? I want them loose somehow not tucked inside the apk.
Forget the SD card. Not possible with standard CX. And there is no guaranteed way to get that directory anyway. It changes almost with every Android release. Sometimes Android blocks its access also.
 

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
715
SaveString, FileStream and DataBuffer come to my mind.

LoadDir is totally new to me
How do all these ways of reading files differentiate? String are for strings I understand so FileStream and DataBuffer are my two choices because I want to use binary bytes and integers.

Can you stream realtime from the web using filestream?

Which one of all these would you suggest to learn first if you where to use file cross all platforms? Web is important.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,042
LoadDir is totally new to me
Studying the help files of a programming language/tool upfront to see it what functionality it provides is something I always recommend and do so myself.

Regarding using FileStream, Android and SD card... you must have forgotten your own posts and discoveries...


Web is important.

On Web you can only use SaveString to store data inside the browsers local storage. Well I could think of using a php script in combination with httprequests and store data onto a server. But that goes beyond my time here.

How do all these ways of reading files differentiate? .... FileStream and DataBuffer .....
Well with FileStream you can use to write and read from files down to a byte level. Databuffer can load a file into memory and then read and write to that memory. I recommend to read the documentation on these parts, I think it explains it well.
 

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
715
The helpfiles are huge, me persoanlly have not even been able to read half of it yet and I've tried for few weeks now.
It's hard to know where to start. I need to check those documents out I have no memory of discovered anything.

Thanks, at least I know more where to start looking now, I will try understand how to talk to a Node server next that would be a great help saving levels and highscores.
 

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
715
I just got used to it basically, no reason whatsoever other than that. I've been doing some multiplayer coding in JavaScript and love it.

I'm happy to take any suggestions for back-ends that's easy to use and has good pricing.
 
Top Bottom