home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.hp48
- Path: sparky!uunet!seq!spell
- From: Daniel COHEN-LAROQUE <COHEN_LA@eldi.epfl.ch>
- Subject: v07i040: mbuilder.dc - Menu Builder v1.0, Part01/01
- Message-ID: <1992Nov19.195618.18939@seq.uncwil.edu>
- Followup-To: comp.sys.hp48
- Sender: spell@seq.uncwil.edu (Chris Spell)
- Organization: Univ. of North Carolina @ Wilmington
- Date: Thu, 19 Nov 1992 19:56:18 GMT
- Approved: spell@seq.uncwil.edu
- Lines: 285
-
- Checksum: 3685736460 (verify with brik -cv)
- Submitted-by: Daniel COHEN-LAROQUE <COHEN_LA@eldi.epfl.ch>
- Posting-number: Volume 7, Issue 40
- Archive-name: mbuilder.dc
-
- BEGIN_DOC mbuilder.doc
-
- Hello FortyEighters!
-
- Several hackers asked 2 or 3 weeks ago for some info about menus.
- The problem was to build sub directory menus with the MENU & TMENU
- commands. The answer might be :
- {{ << grob 21x8 << {{ "back" <<0 menu>> }} TMENU >> }}
- but of course a grob is fastidious to make and eat furthermore our precious
- RAM. That was enough for me to find a better way to achieve this task.
-
- The following program is a recursive menu compiler. It's a sytem-RPL code
- which compiles a list (menu) in level 1 and returns his system-RPL equivalent.
- The program is fast (about 2 seconds for a classical menu, depending on how
- huge yours is) and performs lots of tasks described below.
-
- GREAT! It's time to try it...
-
- Fist of all, I did my best to keep the MENU format. So, you just need to add
- a single parameter per assigned key: this lets you modify your olds menus.
-
- IMMMMMMMMMMMMM;
- : MENU SYNTAX :
- HMMMMMMMMMMMMM<
- The basic format is the following:
-
- {{ KeyType1 KEY1 AssignedArea1 } { KeyType2 KEY2 AssignedArea2 } ... }
-
- IMMMMMMMMMMMMKMMMMMMMMMMMMMKMMMMMMMMMMMMMMMMMMMMMMMMMMMKMMMMMMMMMMMMMMMMMMMMM;
- : KeyType : Key : AssignedArea : Note :
- LMMMMMMMMMMMMNMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMM9
- : "S" : String : ....//{..../ ..../ ..../} : Like normal menu :
- : (Standard) : : : :
- LMMMMMMMMMMMMNMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMM9
- : "R" : " : " : Like Solver menu :
- : (Reverse) : : : :
- LMMMMMMMMMMMMNMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMM9
- : "G" : Grob : " : Like the grob :
- : (Grob) : : : :
- LMMMMMMMMMMMMNMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMM9
- : "F" : String : Real Number + user flag : Like Beep in the : :
- : (Flag) : : - system flag : Modes menu (VAR key):
- LMMMMMMMMMMMMNMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMM9
- : "D" : String : Basic format, see : Not limited in the :
- : (Directory): : provided example : number of dir. :
- HMMMMMMMMMMMMJMMMMMMMMMMMMMJMMMMMMMMMMMMMMMMMMMMMMMMMMMJMMMMMMMMMMMMMMMMMMMMM<
-
- Once your list is written, push it on level 1 and evaluate MBUILDER. You
- should get the executable code menu. This code can be stored in any
- variable, CST excepted. Recalling this variable causes a temporary menu
- (like the TMENU command).
-
- Now, instead of building a temporary menu, you can make a 'CST' one
- (permanent menu like the MENU command). For this, push 'CST' in level 2
- and your list in level 1, then evaluate MBUILDER. In this case,
- the ***LOCAL*** 'CST' variable will be created/replaced and
- directly contains your menu. Recall it by pressing the CST key.
- (Maybe the arguments can appear not very logical, but that's not very
- easy because MBUILDER recursively builds the menu, trust me!)
-
- IMMMMMMMMMMMMMMMMMMMMMM;
- : ERROR MESSAGES TABLE :
- HMMMMMMMMMMMMMMMMMMMMMM<
- Because of using systemRPL code, I tried to trap the maximum of syntax errors.
-
- "Hey, {}? Nice Menu!" : Null list entered
-
- ":Syntax: {} missing" : The sub element is not a list
- i.e. { {} "S" "KEY" ..../ }
-
- "Need #3 Parameters" : The sub list does not exactly contain 3 elements.
-
- "Max #3 Def. Per Key" : The Assigned Area(if list is used) must
- contain <= 3 programs.
-
- ":Program Expected:..../" : Means the Assigned Area is not a program or
- does nor contain programs if list is used.
-
- ":Grob Size: 21x8 Only" : i.e. { { "G" grob21x7 ..../} }
-
- ":Bad Configuration:
- Check List" : i.e. { { "G" "example" { ..../ ..../ } } or
- the keytype is not one of the following ones
- "G" "S" "D" "F" R"
-
- IMMMMMMMMMMMMMM;
- : SOME ADVICES :
- HMMMMMMMMMMMMMM<
-
- - A menu like { { "S" "example" { ./ . DROP / } } provides the DROP command
- for left-shifted key and a DoBadKey (Error Beep) for non-shifted and
- right-shifted keys.
-
- - The output compiled menu is a systemRPL code but the userRPLprograms
- attached to the keys are still in userRPL. That means the menu should be
- safe to use (for people scared to see 'external' on the stack!).
- Of course, systemRPL programs are not changed too.
-
- - Executing MBUILDER without any arguments displays the necessary help.
-
- - When the "D" & "F" keytypes (Directory) are used, the grob is build each
- time the menu is launched (in order to save RAM).
-
- - { "S" "back" . 0 MENU / } displays the upper directory. See the provided
- example. However, I didn't solved the problem of going back when more
- than one sub directory is used. Tell me if you 've found the solution!
-
- - Don't forget to call the program MBUILDER (Upper case letters)
-
- IMMMMMMMMMMMMMMMMM;
- : STILL FEW WORDS :
- HMMMMMMMMMMMMMMMMM<
-
- I didn't write this tool to replace each time the MENU command but to improve
- your menus. All the things are not perfect: once a menu has been compiled,
- it can't be extracted anymore.(A program could be written for this! Maybe
- in the next release...) So, I recommend to save a compressed version
- of the menus you compiled or use MBUILDER for the menus you don't change
- anymore (if they exist!)
-
- This soft is posted in the hope it will be usefull,
- but without any WARRANTY. It has been successfully tested
- on my calc (Revision E), but can still contain some bugs.
- MBUILDER is freeware, but I want my name to be attached to the soft.
-
- If you find MBUILDER usefull enough to keep it in either your calc or you PC,
- please mail me a postcard.
-
- Use my e-mail for any improvements, suggestions etc...
- Dan.
-
- --:
- Daniel COHEN_LAROQUE Address : Les Pommeraies
- Swiss Federal Institute of Technology 74160 ARCHAMPS
- Communication Sciences FRANCE
- ----><----
- "Notre nature est dans le mouvement, Voice : (+33) 50.43.71.67
- le repos entier est la mort." e-mail : cohen_la@eldi.epfl.ch
- Blaise Pascal
-
- END_DOC
-
-
- BEGIN_ASC mbuilder.asc
- %%HP: T(3)A(R)F(.);
- "D9D202BF8112040D9D20F6A36CB916D9D20C2A20B2000845697C202B7D7F302E
- 496365602D656E6571284051B2130EA431C2A20F2000245796C64696E6760235
- 97372505C402D456E657F1504219E550FC436FA450D7ED5BD37011226A2170D9
- D20C2A20F2000A33597E647168702A30202B7D702D696373796E676794708405
- 1B2130F6A368DA16D9D204423079E6017CE3B2130D9D20FA450D0040E4D30CB9
- 16D9D20C2A2092000E45656460232330205162716D656475627377947084051B
- 2130EF11688130C2A20700004479B3032230C2A20700006491636A2170D9D201
- 12268DA16D9D20FA450D7ED588130D004038D30CB916D9D2079470C2A20B2000
- D4168702323302445666E20207562702B4569784051B2130B21309FF309E550F
- C4363C3707E126A2170D9D2079470C2A20F2000A30527F6762716D6025487075
- 636475646A3BAF1BB84051B213088130C2A20B0000BA02BB7314179B308DA16D
- 9D2044230EFDF3B2130D9D2079E60D9D2088704B213032230F1250B213070F26
- AF2500E516433706B436B213033F06D9D2088130C2A20700003579B30EF11695
- 12664B307F816D9D2079E60D9D2088704B213032230AF25079E60823A3AF250B
- 213088130C2A20700002579B30EF1169512664B307F816D9D2079E60D9D20887
- 04B213032230AF25079E60E44A3AF250B213088130C2A20700007479B30EF116
- 1022664B307F816D9D20E97159B136F30401C0409B13679B30A2170D9D207947
- 0C2A20F2000A37427F626023596A756A3022313878302F4E6C69784051B2130B
- 213088130C2A20700006479B30EF1169512664B307F816D9D207472696126A21
- 70D9D20C2A2013000A364C6167602E457D6265627025487075636475646A3794
- 7084051B21307D8A232230009A2AEC815923047A20D6E204066C61676D6E2030
- 374727B21300D47079E60D9D2088704B213088130D6E204066C61676AF250592
- 30683A21C8A28DA16D9D2079E60D9D2088130DEE361673513735B2130F125032
- 23079E60EECE3AF250B2130D9D2079E60D9D20881309DE365573552735B2130F
- 12503223079E60D9D2088704ED9368773599CE3B2130AF250B2130D6E2030374
- 727AF250D6E204066C61676AF25079470B213088130C2A20700004479B30EF11
- 69512664B30C12166122664B307F816D9D2079E60D9D2088704B213032230AF2
- 5079E60CE3A3AF2503223084E2080D4245594C444542532230B2130D9D20C2A2
- 014000A32416460234F6E66696765727164796F6E6A3A034865636B602C49637
- 4784051B2130B2130DEE3232230AF250B213070F26AF2500E516433706B436C4
- 1300F636CB916D9D202C23079E604B11279B30CB916D9D203223031581D4170B
- 2130B21307EF3679E6068F04AF250B2130FEF30D9D20CA03113593FC2E4D0040
- 30040C2A20F2000D456E657245796C6465627022497024416E672932300D110B
- 821CF14653621CF14642D46D5040F2911FF2210B8217604088130C2A20F30005
- 6D2D61696C6A30236F68656E6F5C6160456C64696E2560766C6E2368608F110B
- 821FEF303A0408813042D463223071B05C2A2034000727235727202B5354746D
- 5A302020202027272020202020202020202027272C2A2014000727225727202B
- 5255667D5A3020235472796E67602020202020202027272C2A20940007272747
- 27202B57427F626D5A3027427F6260202020202B45697C4963747F2052776C2A
- 2054000727264727202B564C61676D5A30202020272720202020202021B32026
- 4C61676C2A2054000727244727202B5449627D5A302020235472796E67602020
- 2C4963747D456E657B2040EC3703004012270B20402CE30B7040CBD305923008
- F110B821433709FF30E4B46C2A2074000B7027272459707567272020202B4569
- 7E416D656020205162716D65647562702D708F110B8219E040A8B46C2A20F100
- 005275637370216E69702B6569700D110B82156F1485230EA431C2A205C00002
- 0202020202025537167656A3A002A313A302D456E65702C4963747A0D8025487
- 563657471626C65602D456E657A0A002A313A302D456E65702C4963747A002A3
- 23A3027234354572A0D8A0C4F63616C60234354502D456E6570237166756469F
- F30F3040EC4A3F2293B2130B21300111"
- END_ASC
-
- BYTES: #1110h 1550
-
- BEGIN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,:7-T"B`Z,CH@)T-35"<*C0I,;V-A;"!#
- <4U0@365N=2!S879E9/D_\`,$SJ3S(CDK,;`2`[`2
- `
- end
- sum -r/size 38053/2175 section (from "begin" to "end")
- sum -r/size 63278/1558 entire input file
- END_UU
-
- BEGIN_RPL example
- %%HP: T(3)A(D)F(.);
- { { "S" "STD" {
- \<<
- "Standard Key
-
- Left \-> bad key
- Right \-> 'right'"
- CLLCD 2 DISP 7
- FREEZE
- \>>
- \<<
- \>>
- \<< "Right Shifted"
- CLLCD 2 DISP 7
- FREEZE
- \>> } } { "R" "REV"
- \<< "Reverse Key"
- CLLCD 2 DISP 7
- FREEZE
- \>> } { "G"
- GROB 21 8 7C7CF110000110000191B131100001100001100001FF0E11
- \<< "Grob Key" CLLCD
- 2 DISP 7 FREEZE
- \>> } { "F" "TIME"
- -40 } { } { "D"
- "DIR" { { "S" "IN"
- \<< "Inside Dir"
- CLLCD 2 DISP 7
- FREEZE
- \>> } { } { "R"
- "BACK"
- \<< 0 MENU
- \>> } } } }
- END_RPL
-