| Menu | JAQForum Ver 19.10.27 |
Forum Index : Microcontroller and PC projects : Programming Advice
Hello, I have a question as I am getting to learn a little programming, and don't have any formal experience. I am trying to create a rudimentary program in MMBASIC for DOS, and to move it to the MM2 in the future. The plan is to get a line input from the user and compare that string to a list of possible keywords in an array. That part is understandable. However, I would like to use that string after some string manipulation code, to branch to another part of the program, preferably a label, but can be a sub. In other words, use a string as an entry to a part of the program, which will end there, or jump back to the start if the user wishes. I thought this is what the eval(s$) function is for, and that I would pass "GOTO Keyword" eval("GOTO Keyword") 'Where Keyword is a variable obtained from user. Or, just plain Goto Keyword 'Where Keyword is a variable obtained from user at runtime. Is this possible to do so in BASIC. |
||||||
Yes you can GOTO or GOSUB to a label but look at multiline IF-THEN-ELSE first INPUT "Command";c$ IF c$="THIS" THEN do this code ELSEIF c$="THAT" do some other code ELSEIF c$="THE OTHER" do some other code still ELSE finally, if the other choices don't fit, do this code END IF |
||||||
Look at the "CALL" command. (Maybe unavailable for the MM2.) Edited 2026-06-28 14:06 by vegipete |
||||||
Oh yes, that was another thing. Looks like that’s available on CMM2 too https://geoffg.net/Downloads/Maximite/Colour_Maximite_2_User_Manual.pdf Page 69 Edited 2026-06-28 16:02 by Martin H. |
||||||
CMM2 and MM2 are 2 totally different platforms. The MM2 is more like a picomite with version 5.5 MMbasic, less memory an 30% of the speed. Volhout |
||||||
| The Back Shed's forum code is written, and hosted, in Australia. |