Menu
JAQForum Ver 19.10.27

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

   Page 4 of 17    
Posted: 06:02pm
13 Nov 2024
Copy link to clipboard
javavi
Guru


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
 
Posted: 08:11am
14 Nov 2024
Copy link to clipboard
Volhout
Guru

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$()
 Print
 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
 
Posted: 08:26am
14 Nov 2024
Copy link to clipboard
Mixtel90
Guru


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 "Сподіваюся на мир, незалежність та процвітання України".
 
Posted: 08:53am
14 Nov 2024
Copy link to clipboard
twofingers
Guru

  Volhout said  Hi javavi,

This may be usefull. You make your own INPUT statement in a function.
...

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
 
Posted: 02:29pm
15 Nov 2024
Copy link to clipboard
Volhout
Guru

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$()
 Print
 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
 
Posted: 01:07am
17 Nov 2024
Copy link to clipboard
javavi
Guru


  Mixtel90 said  "Сподіваюся на мир, незалежність та процвітання України".

Glory to Heroes!
Thank you very much Mixtel90 and everyone for your support.
 
Posted: 01:23am
17 Nov 2024
Copy link to clipboard
javavi
Guru


  Volhout said  This may be usefull. You make your own INPUT statement in a function.

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?
 
Posted: 10:34am
17 Nov 2024
Copy link to clipboard
javavi
Guru


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.
 
Posted: 02:04pm
17 Nov 2024
Copy link to clipboard
homa
Guru


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
 
Posted: 06:06pm
17 Nov 2024
Copy link to clipboard
javavi
Guru


  homa said  FM v1.12 - test @: PicoMiteHDMI MMBasic USB RP2350A Edition V6.00.00RC15
@javavi: Otherwise a very successful file manager! Good luck with the finishing touches!

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!  
 
Posted: 09:15am
18 Nov 2024
Copy link to clipboard
Volhout
Guru

Hi javavi,

You may want to add the play of WAV files. All pico's support playing WAV files.

Volhout
 
Posted: 10:04am
18 Nov 2024
Copy link to clipboard
PhenixRising
Guru

  Quote  File manager for PicoMite


But will this also run on the CMM2?
 
Posted: 10:58am
18 Nov 2024
Copy link to clipboard
Mixtel90
Guru


Unlikely. Try it. :) Javavi can't sort that out, I don't think.
 
Posted: 11:11am
18 Nov 2024
Copy link to clipboard
Volhout
Guru

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
 
Posted: 08:17am
22 Nov 2024
Copy link to clipboard
Volhout
Guru

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
 
Posted: 08:24am
22 Nov 2024
Copy link to clipboard
javavi
Guru


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.
 
Posted: 08:47am
22 Nov 2024
Copy link to clipboard
Volhout
Guru

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
 
Posted: 08:54am
22 Nov 2024
Copy link to clipboard
Mixtel90
Guru


VAR SAVE?
 
Posted: 09:04am
22 Nov 2024
Copy link to clipboard
Volhout
Guru

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
 
Posted: 09:13am
22 Nov 2024
Copy link to clipboard
javavi
Guru


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 17    
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025