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 : File Manager for PicoMite
Page 4 of 6 | |||||
Author | Message | ||||
javavi Senior Member Joined: 01/10/2023 Location: UkrainePosts: 204 |
Forgive me if I don't answer for a long time, here in Ukraine we have a real War going on, with daily missiles, drones and other nasty things. Hi mclout999, Unfortunately, I don’t have any other hardware except for the Murmulator with VGA on which I could check this, apparently I need to check the EXECUTE command. Hi Volhout, Yes, probably we need to somehow make a terminal version of the manager, it's a pity that there is no pseudo-graphics. Thank you for your useful advice, I am very grateful, I will fix this in the next release. PS:I still need to figure out how to exit the INPUT input procedure using the ESCape button. Edited 2024-11-14 04:46 by javavi |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4222 |
Hi javavi, This may be usefull. You make your own INPUT statement in a function. This input statement returns an empty string when ESC is pressed. It returns the typed command when it detects you press carriage return (chr$(13)) 'example for function to input keypresses Do Print "type command "; b$=input_esc$() If b$<>"" Then Print "execute ";b$ Else Print "exit " End If Loop Until Instr(b$,"quit") End Function input_esc$() Local a$ Do Do a$=Inkey$ Loop Until a$<>"" If a$=Chr$(27) Then a$="":Exit Do Print a$; input_esc$=input_esc$+a$ Loop Until a$=Chr$(13) End Function You may also want to use Kevin's tip about using TEXT in stead of PRINT in the matrix screensaver 'SCREEN SAVER - Matrix Sub SSMatrix Local matr(CHR),fade(CHR),clr,x For x=1 To CHR:matr(x)=CVR*Rnd:fade(x)=&hF*Rnd:Next Do For x=1 To CHR clr=&h1000*(fade(x)-&hF) And &hFF00 Colour clr Text x*FW-FW,matr(x)*FH,Chr$(Rnd*223+32) 'Print @(x*FW-FW,matr(x)*FH)Chr$(Rnd*223+32); If matr(x)>CVR Then matr(x)=0 Else Inc matr(x) If fade(x)=&hF0 Then fade(x)=0 Else Inc fade(x) Next Pause 50 'Pause 10 Loop While Inkey$="" Colour c(15) End Sub Edited 2024-11-14 18:14 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6772 |
We hear about the war, Javavi. I can't possibly imagine what you are all going through, I have no experience of it. :( My thoughts are with you and your country. Not my language (and I hope the forum software doesn't scramble it), but "Сподіваюся на мир, незалежність та процвітання України". Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1236 |
I updated a 10 year old function. Maybe useful for javavis file manager? https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=17433 Regards Michael causality ≠ correlation ≠ coincidence |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4222 |
Javavi, Minor update to previous function. Now you can also backspace to correct errors. 'example for function to input keypresses Do Print "type command "; b$=input_esc$() If b$<>"" Then Print "execute ";b$ Else Print "exit " End If Loop Until Instr(b$,"quit") End Function input_esc$() Local a$ Do Do a$=Inkey$ Loop While a$="" If a$=Chr$(27) Then a$="":Exit Do If a$=Chr$(8) Then Print a$;" ";a$; input_esc$=Left$(input_esc$,Len(input_esc$)-1) Else Print a$; input_esc$=input_esc$+a$ End If Loop Until a$=Chr$(13) End Function Edited 2024-11-16 00:31 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
javavi Senior Member Joined: 01/10/2023 Location: UkrainePosts: 204 |
Glory to Heroes! Thank you very much Mixtel90 and everyone for your support. |
||||
javavi Senior Member Joined: 01/10/2023 Location: UkrainePosts: 204 |
Hi Volhout, I slightly reworked the File Manager code using your string input function, and slightly corrected errors in various places. Thank you all for your advice and attention. Now I need to test it. FM111.zip I have PicoMiteVGA 6.00.00RC12 There is some strange glitch, when viewing images or opening text files for editing, the top two lines are not visible. Is there such a glitch on the newer version RC15? |
||||
javavi Senior Member Joined: 01/10/2023 Location: UkrainePosts: 204 |
FM v1.12 PicoMiteVGA 6.00.00RC12 FM_v112.zip In addition to the [ESC] and [BS] keys, when editing the input field in forms, I added the [DEL] key, which completely erases the input field. Try, check, test and write your comments here. |
||||
homa Guru Joined: 05/11/2021 Location: GermanyPosts: 351 |
FM v1.12 - test @: PicoMiteHDMI MMBasic USB RP2350A Edition V6.00.00RC15 1) >RUN, F9, LIST COMMANDS, ... 1-2 seconds later: PICO2 RESET 2) Above the function key bar, behind the input prompt, the keys pressed only appear as “code” ... c=99, l=108, s=115, ... shouldn't the input appear here? 3) >RUN, F9, ESC ... ESC ends the software, I would have expected the F9 menu function to end here! 4) Input on a selected file, mp3 starts playback, jpg nothing happens? I would have expected the image to be displayed here. @javavi: Otherwise a very successful file manager! Good luck with the finishing touches! Matthias |
||||
javavi Senior Member Joined: 01/10/2023 Location: UkrainePosts: 204 |
Hi Matthias, Unfortunately, I only have Pico2 itself to test the PicoMite 6.00.00RС15 versions. 1) Yes, I checked, there is such a bug! If you run the command EXECUTE "list commands" which stops for scrolling, the system goes to reboot. 2) I haven't reached the input line yet, the problem may be that same command EXECUTE. 3) Everything is fine here, treat this list of commands as the same list of files, to exit press ENTER at the top when exiting the directory. (by the way, this list can be supplemented with frequently used * programs) 4) I didn't know that PicoMite can load JPG files! This part of FM can be improved by adding launching of all types of files. Thank you for your attention, we will improve it! |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4222 |
Hi javavi, You may want to add the play of WAV files. All pico's support playing WAV files. Volhout PicomiteVGA PETSCII ROBOTS |
||||
PhenixRising Guru Joined: 07/11/2023 Location: United KingdomPosts: 857 |
But will this also run on the CMM2? |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6772 |
Unlikely. Try it. :) Javavi can't sort that out, I don't think. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4222 |
It will require changes for CMM2 - Port all Tiles related commands - Force the CMM2 in 640x480 (default is 800x600). - Check if all formatting of A:/ and B:/ is the same in CMM2 - Some media related (picture/sound) commands are different in CMM2. Volhout Edited 2024-11-18 21:51 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4222 |
FM version 1.12 Bug report: Left pane, choose B:/ Open a (any) folder on B:/ in left pane Focus to right pane Try to open a (any) folder on B:/ in right pane. [161] If Mid$(........ Error: Could not find the path Volhout Edited 2024-11-22 18:30 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
javavi Senior Member Joined: 01/10/2023 Location: UkrainePosts: 204 |
Help me with advice please, Is there any hacker way to run the command line formed in the program after its completion. So that the program, after its completion, could pass the line to the environment for execution, similar to how the function does it by returning the line. |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4222 |
Hi Javavi, The method I would use is to use a second flash slot, in combination with a file an on the A:/ drive. I am not 100% sure it would work, but this is the essence. The helper program in the flash slot could look like this Flash slot 3 (in case you choose 3) must contain a program that does following: OPEN "a:/cmd.txt" for input as #1 INPUT #1,a$ CLOSE #1 KILL "a:/cmd.txt" EXECUTE a$ END In your main program, the command you want to be executed (i.e. "LIST"), write that to a file on A: OPEN "a:/cmd.txt" for output as #1 PRINT #1,"LIST" CLOSE #1 FLASH RUN 3 '-or- FLASH CHAIN 3 I found a complication if you want to pass names that involve double quotes i.e. you want to execute KILL "a:/hello.world". And I have not yet found a suitible solution for my specific case. Volhout EDIT: after reading up, you may even be able to avoid the file on the A: drive, when you use the FLASH CHAIN 3 command, since it leaves the variables the same. If my understanding is right you could in your main program: a$= "LIST" FLASH CHAIN 3 With flash slot 3 code EXECUTE a$ Edited 2024-11-22 18:53 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6772 |
VAR SAVE? Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4222 |
HI javavi, This works (use chr$(34) to enforce quotes in the string) Main program: a$="PRINT "+chr$(34)+"hello world"+chr$(34)+chr$(13) 'your command FLASH CHAIN 3 In flash slot 3 EXECUTE a$ Volhout P.S. please note previous bug report. Edited 2024-11-22 19:09 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
javavi Senior Member Joined: 01/10/2023 Location: UkrainePosts: 204 |
Yes, but using the EXECUTE command does not fully satisfy the requirement. I would like to have full access to the command line of the MMBASIC environment. For example, if I wanted to pass a chain of commands for execution Edited 2024-11-22 19:17 by javavi |
||||
Page 4 of 6 |
Print this page |