Menu
JAQForum Ver 19.10.27

Forum Index : Microcontroller and PC projects : File Manager for PicoMite

   Page 1 of 17    
Posted: 04:47pm
23 Sep 2024
Copy link to clipboard
javavi
Guru


I propose here for discussion the topic of creating a File Manager program for PicoMite.

I would like such a File Manager to be built into the system and called by a command or a functional button, to work both in the terminal and on displays in different resolutions.
I think that such a software shell would be useful in the development and use of PicoMite.



As an example, I give here my attempt to create such a program for PicoMiteVGA (MODE 1), it is not quite finished, but you can already use it.

FM - File Manager.zip

Best regards, javavi.
Edited 2024-09-24 02:50 by javavi
 
Posted: 05:10pm
23 Sep 2024
Copy link to clipboard
twofingers
Guru

@javavi
I think your program is great! Congratulations!
In my copy I have
Option default integer
Mode 1
Option F9 "RUN"+Chr$(34)+"B:FM"+Chr$(34)+Chr$(13)+Chr$(10)

Const FW=MM.Info(FONTWIDTH): FH=MM.Info(FONTHEIGHT)
...
added.
Similar to this:
https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=17173&LastEntry=Y#227156#227154

Kind regards
Michael

PS: In your program you are probably not using this
On ERROR ignore

quite correctly. Maybe you mean
On ERROR skip
??
 
Posted: 06:33am
24 Sep 2024
Copy link to clipboard
Volhout
Guru

Hi twofingers,

When you do following:

LOAD "FM.bas"
FLASH SAVE 2
OPTION F5 "flash run 2"+chr$(13)


Or -in your case- define F9, you have the file manager always available.

Javavi: very good file manager. The only thing I am missing is (as you mentioned) a way to start the editor, and a way to RUN a program.
If you could add these features, I personally would be very gratefull.

Volhout
Edited 2024-09-24 16:36 by Volhout
 
Posted: 07:20am
24 Sep 2024
Copy link to clipboard
twofingers
Guru

Hi Volhout,

thanks for the tip, but that was what I meant with the link to the Electricats post:
  Quote  Similar to this:
https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=17173&LastEntry=Y#227156#227154

  Electricat said  ... I saved small navigator to ->> FLASH 1 slot, then added ->> OPTION F5 FLASH RUN 1  

Now, anytime I want run load program for run/editing I press F5, browse for file I need run/edit >> select&run
After Ctrl+C it can be edited, only changes must be saved using SAVE "****.bas" (F2 will not save)

Unfortunately the link (Copy link to clipboard) doesn't point to the individual post and I haven't checked it.

I don't like the solution with the flash because it costs a slot that is permanently occupied. But to each his own. b

  Quote  ... and a way to RUN a program.

It works for me (I replaced "Edit" with "Run" @Ln: 355). I think that project is very promising. I'm very excited for the next versions.

Best regards
Michael
 
Posted: 08:25am
24 Sep 2024
Copy link to clipboard
Mixtel90
Guru


Could a way be found to run this from the Library? It might save a flash slot.
 
Posted: 08:38am
24 Sep 2024
Copy link to clipboard
phil99
Guru


  p108 said  The library is stored in program memory Flash Slot 3 which will then not be
available for saving a program (slots 1 to 2 will still be available).
 
Posted: 09:05am
24 Sep 2024
Copy link to clipboard
Mixtel90
Guru


Yes? You aren't going to save to that slot are you? Isn't it just a case of running the file manager from there - after loading it into the library (flash slot 3) using LIBRARY SAVE, that is? Unless the file manager writes to the memory that it's running from, of course. I've not checked.
 
Posted: 04:03pm
24 Sep 2024
Copy link to clipboard
javavi
Guru


  Volhout said  
Javavi: very good file manager. The only thing I am missing is (as you mentioned) a way to start the editor, and a way to RUN a program.
If you could add these features, I personally would be very gratefull.


Hi Volhout,
Your request is easy to fulfill.
Now File Manager launches execution of a file with the .bas extension by pressing the Enter key.
In the same way, actions on different files can be organized by file extension.
FM_v11.zip

Also, thank you all for your feedback!
 
Posted: 04:41pm
24 Sep 2024
Copy link to clipboard
twofingers
Guru

Thank you! Much appreciated!
I foun a typo @LN:447
Local ineger x,l=Len(MM.ErrMsg$)

Regards
 
Posted: 05:03pm
24 Sep 2024
Copy link to clipboard
javavi
Guru


  twofingers said   I foun a typo @LN:447

Thank you very much!
Apparently I haven't caught any errors for a long time. :)
If you want, you can modify the code and post it here.
FM_12.zip
Best regards, javavi
 
Posted: 05:28pm
24 Sep 2024
Copy link to clipboard
twofingers
Guru

  javavi said  ...
Apparently I haven't caught any errors for a long time. :)

This could mean that you are a very good programmer. This shows your good programming style or ...

... that you have disabled all error detection by using "On ERROR ignore" instead of "On ERROR skip".
Edited 2024-09-25 03:31 by twofingers
 
Posted: 05:49pm
24 Sep 2024
Copy link to clipboard
javavi
Guru


  twofingers said  
This could mean that you are a very good programmer. This shows your good programming style or ...
... that you have disabled all error detection by using "On ERROR ignore" instead of "On ERROR skip".

I'm not much of a programmer - I'm a self-taught amateur.
I tried to figure out these constructions by trial and error, and somehow applied them... it was a long time ago, I've forgotten now. :)
 
Posted: 07:16pm
24 Sep 2024
Copy link to clipboard
electricat
Senior Member


There is one quite unpleasant moment I noticed.
I am still on 5.08 ver

Program loaded using command RUN $fname and later edited and saved using F1, will display msg "Saved nnn Kb" but in fact it will not be saved.

I must use SAVE "" to save for really.
 
Posted: 09:31pm
24 Sep 2024
Copy link to clipboard
lizby
Guru

  electricat said  I must use SAVE "" to save for really.


F1 and F2 save to flash the edits you have made to your program--as you found, you must uses SAVE "fn.bas" to save the file to either an SD card or to the tiny file system in flash.

F1 and F2 assure that if you power cycle the picomite, your program will be available to RUN or EDIT or LIST with any changes you have made.

It is confusing until you understand where your changes are being saved.
 
Posted: 03:08am
25 Sep 2024
Copy link to clipboard
electricat
Senior Member


 
Posted: 07:48am
25 Sep 2024
Copy link to clipboard
Volhout
Guru

Hi javavi,

I made minor changes.
- fix the RUN command when file names are shorter than 4 characters
- change the tile height back to 12 (some programs change the tile height) so the focus bar is correct height again.

When you flash save the file manager, there is one advantage: it is stored "tokenized" in flash slot. This means it will start much faster (instantly) than when loaded from file system (i.e. B:/fm/fm.bas).

Regards,

Volhout
fm12_bf.zip
Edited 2024-09-25 17:49 by Volhout
 
Posted: 08:00am
25 Sep 2024
Copy link to clipboard
Mixtel90
Guru


Could it be called if it was stored in the library (flash slot 3)? You can have other stuff in there so it might save a flash slot. The whole program may have to be a SUB (with local variables?).

Alternatively, running it from A: would be faster than running it from B:.
Edited 2024-09-25 18:03 by Mixtel90
 
Posted: 08:13am
25 Sep 2024
Copy link to clipboard
Volhout
Guru

Javavi,

There is one thing that you could improve. Currently copying of a file works from A:/ to B:/ and reverse.
But you cannot copy a file that is inside a folder (i.e. B:/test/test.bas to A:/)
There is a red popup "file not found".
Somthing with the path name is not right.

Volhout
Edited 2024-09-25 18:14 by Volhout
 
Posted: 08:17am
25 Sep 2024
Copy link to clipboard
Volhout
Guru

  Mixtel90 said  Could it be called if it was stored in the library (flash slot 3)? You can have other stuff in there so it might save a flash slot. The whole program may have to be a SUB (with local variables?).

Alternatively, running it from A: would be faster than running it from B:.


Library is not usefull. Then all file manager subs and code becomes part of your main program. And how do you envision running the file manager. You will run your program in memory also. Remember library is simply a part of your main program.

Volhout
 
Posted: 08:26am
25 Sep 2024
Copy link to clipboard
electricat
Senior Member


@Volhout,

I am still on 5.08 firmware (completely lost track on latest stable enough firmware and changes) so I downgraded JAVAVI FM with your latest modifications te be compatible with 5.08

fm12_bf-pm5.08.zip
Edited 2024-09-25 18:28 by electricat
 
   Page 1 of 17    
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025