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 6 of 6 | |||||
Author | Message | ||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4048 |
Just spit-balling, but you make the behaviour caller defined and transient: The "shell" calls: RUN "app.bas" [, args$] [ ON END RUN n | filename$ ] And when "app.bas" ends it will then RUN flash slot 'n' or 'filename$'. You could get additionally tricksy by: 1. Having a variable Mm.EndCmdLine$ or suchlike, the value of which would then be passed as the command line args when processing the ON END RUN. 2. Also having an optional ON ERROR RUN which would automatically receive the error number and message as its command line args. HOWEVER ... I'm not convinced we are addressing @javavi's use-case. @javavi could you provide an explicit example of something you want to do rather than describing it in generalities ? Best wishes, Tom Edited 2024-11-23 04:50 by thwill Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
javavi Senior Member Joined: 01/10/2023 Location: UkrainePosts: 246 |
Maybe I didn't quite understand your solution. It seems redundant to me to run another program from flash to execute the string. Why not just enter the string (if it is defined) upon program termination into the command line environment? Edited 2024-11-23 04:59 by javavi |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1263 |
Peter: If the program knows that it is already saved (flag) there is no risk. But I don't want to insist ... causality ≠ correlation ≠ coincidence |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6835 |
If the concept is to run an application at the command line on instruction from File Manager then it's flawed. There can only be a single instance of MMBasic, which is running continuously. It's just that it has two forms: command line and runtime. The runtime can accept an argument when it is started from the command line but there is no point in it trying to return an argument as there is nothing to return to - at best it can END and drop out to the command line or FLASH CHAIN to another program that is also stored in flash. The runtime isn't being called at all, operation is being handed over to it. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4048 |
It can also just RUN another program (with or without command line args), note you don't need to EXECUTE "RUN ..." you can just RUN ... Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9177 |
javavi As Tom says, please state the requirement rather than a solution. Then we can understand what, if anything, is an appropriate safe way of meeting it. |
||||
javavi Senior Member Joined: 01/10/2023 Location: UkrainePosts: 246 |
I need the program from the runtime environment to be able to pass a string of characters directly to the command line after completing its work. For example, like this: .... MM.End$="FILES"+Chr$(13) End And after the program completed, the content of this MM.End$ was entered into the command line. > FILES .... Edited 2024-11-23 05:35 by javavi |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4048 |
Ok, so FILES is a corner case because it can't be executed from within a program, but you could write a BASIC program that duplicates its behaviour and call that from your FM using RUN. Any other examples? Tom Edited 2024-11-23 05:39 by thwill Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
javavi Senior Member Joined: 01/10/2023 Location: UkrainePosts: 246 |
I also want to accept any user-entered string in the program for execution. But don't offer the EXECUTE command, since it has limitations. Edited 2024-11-23 05:45 by javavi |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4048 |
Write the commands that the user wants to execute into a temporary file, then RUN that file, you can even have that file then RUN the file manager again. Off the top of my head the things you can't do from a program are FILES, EDIT (did that change recently?) and setting some of the OPTIONs ... most of which require the PicoMite to reboot anyway. Best wishes, Tom Edited 2024-11-23 05:50 by thwill Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3820 |
Because in MMBasic there isn't such a command line environment to return to. Peter's current suggestions may well be as much as you actually need. John |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4048 |
Sure there is, the part of the firmware that handles the prompt. I'm fairly sure what is being asked for *could* be implemented (hacked in) ... it's just *strange* and if every bit of *strange* was implemented then MMBasic would be bloated and probably unusable. Best wishes, Tom Edited 2024-11-23 06:43 by thwill Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3820 |
OK, I guess I meant there isn't one at the moment of the kind being requested. John |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6835 |
The command line is for a user to enter commands. It isn't designed to auto-run things unless it's a program that's been designated as auto run. It certainly isn't designed to run any other commands automatically as it should be impossible. You don't want to get locked out of the system because it keeps running FILES/n continuously. If you set OPTION AUTORUN ON and OPTION BREAK 0 you are (more or less) in the wet and smelly over your wellies. :) It's a similar thing if you can auto run command line commands. It's commonly regarded to be a "bad thing". :) There is no OS environment. The command interpreter, editor and BASIC interpreter are all one and the same no matter how they appear. Get one stuck and the whole system crashes, it's completely irretrievable. Giving BASIC control of the command interpreter is giving it control of the routine that passed control to it. You can't "call" it as you got into BASIC via a Jump command - there is no return mechanism. Peter's MM.END is probably the best you can do to keep the system stable. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1263 |
My keyboard is only connected via Teraterm. Unfortunately, switching with the ALT key does not work. I have therefore temporarily replaced the ALT key with the backspace key (chr$(8)). This means I can also use the ALT-F keys. FM v1.12, Line #69: Case 135 'End SetPControl("BOT") Case 136 'PgUp SetPControl("PREV") Case 137 'PgDn SetPControl("NEXT") Case 8 'Alt 'was Case 139 'Alt 'Case 8, 139 'Alt or Backspace SetAltPControl() Case 145 'F1-Help SetPControl("DIS") PrintHelp() PanelsReStore() Case 146 'F2-ReName BTW. I can't find a table of "Special Keyboard Keys" in the manual. Am I just blind? From the Maximite Manual: Edited 2024-11-25 02:19 by twofingers causality ≠ correlation ≠ coincidence |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4271 |
Hi javavi, Today I did a lot of testing of programs with the new V6.00.01RC1 firmware. Used your FM to navigate through the folders on B:/ a lot, and it works great. A very handy tool. If you have time to investigate the issue with copying files from B:/ to B:/ that would be great. The issue is that when in the left pane you open a folder on B:/, and try to do the same in the right pane (open a different folder on B:/), you get an error. This is on 1.12 Volhout Edited 2024-11-26 06:28 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1263 |
Thanks Harm for the Freepins() idea! https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=17466&LastEntry=Y#230142#230129 I included the sub in the File Manager. Sub FREEPINS() Local integer n,p Local string gp$,pu$ For n=0 To 29 gp$ = "GP"+Str$(n) On error skip p = MM.Info(pinno gp$) If Not MM.Errno Then pu$ = MM.Info(pin p) Else p=-1 pu$=MM.ErrMsg$ EndIf Print gp$;@(50,MM.Info(vPOS)) p, pu$ Next End Sub and replaced this: Sub GetMenuList(ML$(),LS%()) ML$(0)=".." ML$(1)="> MEMORY" ML$(2)="> FLASH LIST" ML$(3)="> OPTION LIST" ML$(4)="> LIST COMMANDS" ML$(5)="> LIST FUNCTIONS" ML$(6)="> FREEPINS" ML$(7)="" LS%(0)=6:LS%(1)=0:LS%(2)=0 End Sub Regards Michael EDIT: Seems to be obsolete already!? Edited 2024-11-27 05:29 by twofingers causality ≠ correlation ≠ coincidence |
||||
javavi Senior Member Joined: 01/10/2023 Location: UkrainePosts: 246 |
FM v1.13 PicoMiteVGA/HDMI 6.00.01RC2 - handling the error of no SD card - additional BS button for Alternative functions - loading F9 Menu from DATA - minor fixes... FMv1.13.zip |
||||
Page 6 of 6 |
Print this page |