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 : (MM/DM) Help File
Author | Message | ||||
Bryan1 Guru Joined: 22/02/2006 Location: AustraliaPosts: 1344 |
G'day Guy's, Well after about 2kg's of caffine and many a long night I can finally release the first version of the help file. So far 74 .bas files have been made, one for each command and of course the main front page. There is still the functions and a heap of other stuff to do but the full command set has been done. I have tested the code on both the SM1 and the Duinomite and no errors were found. Some pages still need some editing as the lines are too long and I haven't tested it on composite mode so the line may need to be even shorter to accommodate it. I do want this to be fully open source and put code examples on each page so everyone can get information quickly and easily to help them along with learning and moving forward with both the Maximite and Duinomite. The attached file is a zipped folder called 'help' which you can put on the SD card. Then to access the help file it's as easy as CHDIR "help". LOAD "help". RUN "help". I would love it if we could just hit F1 to invoke the file but this may have to mean it will be done in the firmware if the autorun.bas file can't do it. Guy's feel free to edit the pages to add more content or add code snippets and let's all help to make this the main help file for this great new project Geoff has given us. I would like to suggest if any bas files are edited to put the new content on this thread so members can update the files easily. A BIG Thank You goes out to BigMik for helping me and being the 'test bunnie' and when that lager brew of mine finally finishes I'll send 1/2 dozen over so he can wash the peanuts down...... Also a BIG Thank You to Don for the support too.... 2011-12-02_094540_help.zip Regards Bryan |
||||
donmck Guru Joined: 09/06/2011 Location: AustraliaPosts: 1313 |
That's fantastic Bryan, As you suggest, what it needs is a hook into BASIC, so that F1 invokes it. By the same token, it also needs the current basic file saved when F1 is hit, and restored when you exit the help program. Could be a temp file on the A: or B: drive, and deleted after the program is restored. So possibly you need an escape to exit, to restore the original program. This way, it becomes a true help system. It needs to be non-case sensitive on input, but I think that would be simple. And with several gig on most cards these days, think of what you could do with the F2 key. Cheers Don... https://www.dontronics.com |
||||
donmck Guru Joined: 09/06/2011 Location: AustraliaPosts: 1313 |
I think the best way to do this would be to convert them to text files and i can
add a help command to basic .. that would work like this help circle that way if you were editing a program and wanted to lookup a command you would not have to save and load another basic program plus you could also use it in any program so if you wanted to have help screens you could do 20 help "b:\help.txt" and it would not take up program space to display it ken Ken posted this solution in his forum Cheers Don... https://www.dontronics.com |
||||
Bryan1 Guru Joined: 22/02/2006 Location: AustraliaPosts: 1344 |
Hi Don, As you know I have spent weeks on this and did find out early both the DM and MM only have a max of 32k of program memory. So with the Help of Mick by using separate files only 1 file is opened in the help file at any one time. Lets take an example say with the circle command the example could be put on the page and an input made where a user can input variables then a circle would be drawn to what the user inputted (try doing that in a text file). The whole concept behind this is the help file is a interactive file for both new members and experienced users. As I do get to learn more I will be trying to make some interactive pages where a newbie can type in variables and the where in the case of an image command the image will be drawn. In the MMBasic manual it does state 10 files can be open at one time but at present there is no information on how one can switch between open programs. Like you said above it may take a firmware change to use F1 to open it and F2 to close it while the users file remains open. Also with the idea of open source members can make new help pages etc then add them to the help folder and the "query$" will pick any new files once the front page has been updated and show them. The only code that needs to be put in a help file is:- 240 PRINT "Press `ESC' to return to the search"; 250 a$=INKEY$:IF a$="" THEN GOTO 250 ' make sure the goto match's the line number 260 IF a$=CHR$(27) THEN RUN "help" Then the users help file will run in the program fine along with an update to the front page to show the code needed to show the page. We did try to make this whole project as simple as possible so adding new pages will be easy. Now when I was trying to do all in one file I only as far a M with the command set and maxed out the program memory. Now having each command etc in a separate file hardly any program memory is used so yes it all comes back to yes one can have 10 files open at once but how that is done hasn't been shown to my knowledge and I just about know that user manual by heart after referencing it many time over the last few weeks. Regards Bryan |
||||
ajkw Senior Member Joined: 29/06/2011 Location: AustraliaPosts: 290 |
Bryan, Lots of great work done there. The limit is files open to read and write to, not program files. Picking up on Ken's idea using text files but using them with the current firmware, if the help information was in individual text files you could read the "data" into your main help program and hence never leave it. I have attached an example below. The other thing that would be handy when swapping from one running program to another would be a new MM.variable say MM.OLDFNAME$, that way the new program would 'know' who called it and hence who to pass back to. Regards, Anthony. help.bas 10 OPTION error continue 20 CLS 30 FONT 1,1,1 : PRINT " Maximite Help " : FONT 1 40 PRINT : PRINT "Commands are" 50 PRINT "HELP, etc, etc" 60 PRINT 70 LOCATE 0,80: PRINT "Enter quit to quit" 80 LOCATE 0,100: INPUT "Enter command"; cmd$ 90 IF UCASE$(cmd$) = "QUIT" THEN LOCATE 0,400: END 100 PRINT 110 ' 120 ' 130 ' 150 OPEN cmd$+".hlp" FOR input AS #1 160 IF MM.ERRNO = 6 THEN 170 SOUND 1000,100 180 PRINT "Not a valid command" 190 PAUSE 1000 : GOTO 20 200 ENDIF 205 PRINT "------------------------" 210 LINE INPUT #1,hdr$ 220 FONT 2: PRINT hdr$ 230 FONT 1 240 DO 250 chr$ = INPUT$(1, #1) 260 IF chr$ = CHR$(13) THEN PRINT : chr$ = "" 270 IF chr$ = CHR$(10) THEN PRINT : chr$ = "" 280 PRINT chr$; 290 LOOP UNTIL EOF(1) 300 CLOSE #1 310 FONT 1,1,2 320 PRINT: PRINT "Press any key to continue" 330 FONT 1 340 IF INKEY$ = "" THEN GOTO 340 350 GOTO 20 [/code] with a text file help.hlp HELP This is the help command. It is useful for help. This is a long line to test word wrap when the Maximite hits 80 characters in VGA mode. [/code] |
||||
DuinoMiteMegaAn Senior Member Joined: 17/11/2011 Location: AustraliaPosts: 231 |
I took Bryan's1 "help" MMBasic code help snippets and converted them to a PDF using the free OpenOffice 3.0 word application. I sorted all the help code snippets in alphabetical order and put one basic code snippet per one PDF page except for the long ones. A spell checker was applied to fix all the obvious spelling errors. (Brian used Sparkey's spell checker and there were a lot of spelling errors) From this PDF document, you can easily "copy and paste" the basic code help snippets, if need be. I used them as a reference tool. Also, I included CrackerJack's quick MMBasic reference. Enjoy The attached PDF is the document "Bryan1_Code_Help_Snippets_R1.PDF" 2011-12-04_133735_Bryan1_Code_Help_Snippets_R1.pdf The attached zip file contains the source document OpenOffice "odt" file for user additions, deletions and corrections and to generate another PDF file. 2011-12-04_133811_Bryan1_Code_Help_Snippets_R1.zip |
||||
Print this page |