home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / hp48 / 5762 < prev    next >
Encoding:
Internet Message Format  |  1992-11-16  |  12.8 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!ghost.dsi.unimi.it!univ-lyon1.fr!chx400!sicsun!disuns2!/!cohen_la
  2. From: cohen_la@disuns2.epfl.ch (Daniel Cohen-Laroque)
  3. Newsgroups: comp.sys.hp48
  4. Subject: About MBUILDER
  5. Message-ID: <1992Nov16.133332@disuns2.epfl.ch>
  6. Date: 16 Nov 92 12:33:32 GMT
  7. Sender: news@disuns2.epfl.ch
  8. Organization: Ecole Polytechnique Federale de Lausanne
  9. Lines: 274
  10. Nntp-Posting-Host: disun15.epfl.ch
  11.  
  12.  
  13. Well, since some users told me they haven't see a version of MBUILDER, I post
  14. once more to this newsgroup (I don't understand what's going on comp.sources.hp48.
  15. ------------------------------------------------------------------------------
  16. BEGIN_DOC mbuilder.doc
  17.  
  18.       Hello FortyEighters!
  19.  
  20. Several hackers asked 2 or 3 weeks ago for some info about menus. 
  21. The problem was to build sub directory menus with the MENU & TMENU
  22. commands. The answer might be :
  23.    {{ << grob 21x8 << {{ "back" <<0 menu>> }} TMENU >> }}
  24. but of course a grob is fastidious to make and eat furthermore our precious
  25. RAM. That was enough for me to find a better way to achieve this task.
  26.  
  27. The following program is a recursive menu compiler. It's a sytem-RPL code
  28. which compiles a list (menu) in level 1 and returns his system-RPL equivalent.
  29. The program is fast (about 2 seconds for a classical menu, depending on how 
  30. huge yours is) and performs lots of tasks described below.
  31.       
  32.       GREAT! It's time to try it...
  33.  
  34. Fist of all, I did my best to keep the MENU format. So, you just need to add
  35. a single parameter per assigned key: this lets you modify your olds menus.
  36.  
  37. IMMMMMMMMMMMMM;
  38. : MENU SYNTAX :
  39. HMMMMMMMMMMMMM<  
  40. The basic format is the following:
  41.  
  42. {{ KeyType1 KEY1 AssignedArea1 } { KeyType2 KEY2 AssignedArea2 } ... }
  43.  
  44. IMMMMMMMMMMMMKMMMMMMMMMMMMMKMMMMMMMMMMMMMMMMMMMMMMMMMMMKMMMMMMMMMMMMMMMMMMMMM;
  45. :   KeyType  :     Key     :       AssignedArea        :         Note        :
  46. LMMMMMMMMMMMMNMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMM9
  47. :    "S"     :   String    : ....//{..../ ..../ ..../} :  Like normal menu   :
  48. : (Standard) :             :                           :                     :
  49. LMMMMMMMMMMMMNMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMM9
  50. :    "R"     :     "       :           "               :  Like Solver menu   :
  51. : (Reverse)  :             :                           :                     :
  52. LMMMMMMMMMMMMNMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMM9
  53. :    "G"     :    Grob     :           "               :  Like the grob      :
  54. :  (Grob)    :             :                           :                     :
  55. LMMMMMMMMMMMMNMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMM9
  56. :    "F"     :   String    : Real Number + user flag   : Like Beep in the    :                     :
  57. :  (Flag)    :             :             - system flag : Modes menu (VAR key):
  58. LMMMMMMMMMMMMNMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMM9
  59. :    "D"     :   String    : Basic format, see         : Not limited in the  :
  60. : (Directory):             : provided example          : number of dir.      :
  61. HMMMMMMMMMMMMJMMMMMMMMMMMMMJMMMMMMMMMMMMMMMMMMMMMMMMMMMJMMMMMMMMMMMMMMMMMMMMM<
  62.  
  63. Once your list is written, push it on level 1 and evaluate MBUILDER. You
  64. should get the executable code menu. This code can be stored in any
  65. variable, CST excepted. Recalling this variable causes a temporary menu
  66. (like the TMENU command).
  67.  
  68. Now, instead of building a temporary menu, you can make a 'CST' one
  69. (permanent menu like the MENU command). For this, push 'CST' in level 2
  70. and your list in level 1, then evaluate MBUILDER. In this case,
  71. the ***LOCAL*** 'CST' variable will be created/replaced and 
  72. directly contains your menu. Recall it by pressing the CST key.
  73. (Maybe the arguments can appear not very logical, but that's not very
  74. easy because MBUILDER recursively builds the menu, trust me!)
  75.  
  76. IMMMMMMMMMMMMMMMMMMMMMM;
  77. : ERROR MESSAGES TABLE :
  78. HMMMMMMMMMMMMMMMMMMMMMM<  
  79. Because of using systemRPL code, I tried to trap the maximum of syntax errors.
  80.  
  81. "Hey, {}? Nice Menu!" : Null list entered
  82.  
  83. ":Syntax:  {} missing" : The sub element is not a list 
  84.                          i.e. { {} "S" "KEY" ..../ }
  85.  
  86. "Need #3 Parameters" : The sub list does not exactly contain 3 elements.
  87.  
  88. "Max #3 Def. Per Key" : The Assigned Area(if list is used) must 
  89.                         contain <= 3 programs.
  90.  
  91. ":Program Expected:..../" : Means the Assigned Area is not a program or
  92.                             does nor contain programs if list is used.
  93.  
  94. ":Grob Size: 21x8 Only" : i.e. { { "G" grob21x7 ..../} }  
  95.  
  96. ":Bad Configuration:
  97. Check List"             : i.e. { { "G" "example" { ..../ ..../ } } or
  98.                           the keytype is not one of the following ones 
  99.                           "G" "S" "D" "F" R"
  100.  
  101. IMMMMMMMMMMMMMM;
  102. : SOME ADVICES :
  103. HMMMMMMMMMMMMMM<  
  104.  
  105. - A menu like { { "S" "example" { ./ . DROP / } } provides the DROP command
  106.   for left-shifted key and a DoBadKey (Error Beep) for non-shifted and
  107.   right-shifted keys.
  108.  
  109. - The output compiled menu is a systemRPL code but the userRPLprograms 
  110.   attached to the keys are still in userRPL. That means the menu should be 
  111.   safe to use (for people scared to see 'external' on the stack!).
  112.   Of course, systemRPL programs are not changed too.
  113.  
  114. - Executing MBUILDER without any arguments displays the necessary help.
  115.  
  116. - When the "D" & "F" keytypes (Directory) are used, the grob is build each 
  117.   time the menu is launched (in order to save RAM).
  118.  
  119. - { "S" "back" . 0 MENU / } displays the upper directory. See the provided
  120.    example. However, I didn't solved the problem of going back when more 
  121.    than one sub directory is used. Tell me if you 've found the solution!
  122.  
  123. - Don't forget to call the program MBUILDER (Upper case letters)
  124.  
  125. IMMMMMMMMMMMMMMMMM;
  126. : STILL FEW WORDS :
  127. HMMMMMMMMMMMMMMMMM<  
  128.  
  129. I didn't write this tool to replace each time the MENU command but to improve
  130. your menus. All the things are not perfect: once a menu has been compiled,
  131. it can't be extracted anymore.(A program could be written for this! Maybe
  132. in the next release...) So, I recommend to save a compressed version
  133. of the menus you compiled or use MBUILDER for the menus you don't change
  134. anymore (if they exist!)
  135.  
  136. This soft is posted in the hope it will be usefull, 
  137. but without any WARRANTY. It has been successfully tested 
  138. on my calc (Revision E), but can still contain some bugs.
  139. MBUILDER is freeware, but I want my name to be attached to the soft.
  140.  
  141. If you find MBUILDER usefull enough to keep it in either your calc or you PC,
  142. please mail me a postcard.
  143.  
  144. Use my e-mail for any improvements, suggestions etc...
  145. Dan.
  146.  
  147. --:
  148. Daniel COHEN_LAROQUE                        Address :  Les Pommeraies
  149. Swiss Federal Institute of Technology                  74160 ARCHAMPS
  150. Communication Sciences                                 FRANCE
  151.            ----><----       
  152. "Notre nature est dans le mouvement,          Voice :  (+33) 50.43.71.67
  153.  le repos entier est la mort."               e-mail :  cohen_la@eldi.epfl.ch
  154.                  Blaise Pascal                
  155.  
  156. END_DOC
  157. BEGIN_ASC mbuilder.asc
  158. %%HP: T(3)A(R)F(.);
  159. "D9D202BF8112040D9D20F6A36CB916D9D20C2A20B2000845697C202B7D7F302E
  160. 496365602D656E6571284051B2130EA431C2A20F2000245796C64696E6760235
  161. 97372505C402D456E657F1504219E550FC436FA450D7ED5BD37011226A2170D9
  162. D20C2A20F2000A33597E647168702A30202B7D702D696373796E676794708405
  163. 1B2130F6A368DA16D9D204423079E6017CE3B2130D9D20FA450D0040E4D30CB9
  164. 16D9D20C2A2092000E45656460232330205162716D656475627377947084051B
  165. 2130EF11688130C2A20700004479B3032230C2A20700006491636A2170D9D201
  166. 12268DA16D9D20FA450D7ED588130D004038D30CB916D9D2079470C2A20B2000
  167. D4168702323302445666E20207562702B4569784051B2130B21309FF309E550F
  168. C4363C3707E126A2170D9D2079470C2A20F2000A30527F6762716D6025487075
  169. 636475646A3BAF1BB84051B213088130C2A20B0000BA02BB7314179B308DA16D
  170. 9D2044230EFDF3B2130D9D2079E60D9D2088704B213032230F1250B213070F26
  171. AF2500E516433706B436B213033F06D9D2088130C2A20700003579B30EF11695
  172. 12664B307F816D9D2079E60D9D2088704B213032230AF25079E60823A3AF250B
  173. 213088130C2A20700002579B30EF1169512664B307F816D9D2079E60D9D20887
  174. 04B213032230AF25079E60E44A3AF250B213088130C2A20700007479B30EF116
  175. 1022664B307F816D9D20E97159B136F30401C0409B13679B30A2170D9D207947
  176. 0C2A20F2000A37427F626023596A756A3022313878302F4E6C69784051B2130B
  177. 213088130C2A20700006479B30EF1169512664B307F816D9D207472696126A21
  178. 70D9D20C2A2013000A364C6167602E457D6265627025487075636475646A3794
  179. 7084051B21307D8A232230009A2AEC815923047A20D6E204066C61676D6E2030
  180. 374727B21300D47079E60D9D2088704B213088130D6E204066C61676AF250592
  181. 30683A21C8A28DA16D9D2079E60D9D2088130DEE361673513735B2130F125032
  182. 23079E60EECE3AF250B2130D9D2079E60D9D20881309DE365573552735B2130F
  183. 12503223079E60D9D2088704ED9368773599CE3B2130AF250B2130D6E2030374
  184. 727AF250D6E204066C61676AF25079470B213088130C2A20700004479B30EF11
  185. 69512664B30C12166122664B307F816D9D2079E60D9D2088704B213032230AF2
  186. 5079E60CE3A3AF2503223084E2080D4245594C444542532230B2130D9D20C2A2
  187. 014000A32416460234F6E66696765727164796F6E6A3A034865636B602C49637
  188. 4784051B2130B2130DEE3232230AF250B213070F26AF2500E516433706B436C4
  189. 1300F636CB916D9D202C23079E604B11279B30CB916D9D203223031581D4170B
  190. 2130B21307EF3679E6068F04AF250B2130FEF30D9D20CA03113593FC2E4D0040
  191. 30040C2A20F2000D456E657245796C6465627022497024416E672932300D110B
  192. 821CF14653621CF14642D46D5040F2911FF2210B8217604088130C2A20F30005
  193. 6D2D61696C6A30236F68656E6F5C6160456C64696E2560766C6E2368608F110B
  194. 821FEF303A0408813042D463223071B05C2A2034000727235727202B5354746D
  195. 5A302020202027272020202020202020202027272C2A2014000727225727202B
  196. 5255667D5A3020235472796E67602020202020202027272C2A20940007272747
  197. 27202B57427F626D5A3027427F6260202020202B45697C4963747F2052776C2A
  198. 2054000727264727202B564C61676D5A30202020272720202020202021B32026
  199. 4C61676C2A2054000727244727202B5449627D5A302020235472796E67602020
  200. 2C4963747D456E657B2040EC3703004012270B20402CE30B7040CBD305923008
  201. F110B821433709FF30E4B46C2A2074000B7027272459707567272020202B4569
  202. 7E416D656020205162716D65647562702D708F110B8219E040A8B46C2A20F100
  203. 005275637370216E69702B6569700D110B82156F1485230EA431C2A205C00002
  204. 0202020202025537167656A3A002A313A302D456E65702C4963747A0D8025487
  205. 563657471626C65602D456E657A0A002A313A302D456E65702C4963747A002A3
  206. 23A3027234354572A0D8A0C4F63616C60234354502D456E6570237166756469F
  207. F30F3040EC4A3F2293B2130B21300111"
  208. END_ASC
  209. BEGIN_UU mbuilder.uue
  210. table
  211.  !"#$%&'()*+,-./0123456789:;<=>?
  212. @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
  213. begin 644 mbuilder
  214. M2%!(4#0X+46=+2#[&"% T-D";SK&FV&=+<"B BL @%26QP*RU_<#XI0V5@;2z
  215. M5N96%X($%2LQX$H3+"KP @!"=6EL9&EN9R!3>7-24$P@365N=1\%))%>!<\Ty
  216. M]DH%?=ZU/0<1(J82!YTMP*("+P"@,Y7G1A>&!Z(# K+7!]*6-C>7YG9V20=(x
  217. M4+$2 V\ZAJUAG2U ) .7;A#'/BLQT-D"KU30  1./<";89TMP*("*0#@5%9&w
  218. M!C(R P(5)A?65D97)C=W20=(4+$2 _X1AA@#+"IP  !$ESLP(@,L*G   $89v
  219. M-J82!YTM$"%BV!K6V0*O5-#G78@QT  $@SW FV&=+7!)!RPJL ( 36%X(",Su
  220. M($1E9BX@<&5R($ME>4A0L1(#*S&0_P/I5?!,8\-S<!YB*G'0V0*7=,"B B\ t
  221. MH ,E]W8F%]8&4H0'5S9&5T:FL_JQBP05*S& & ,L*K   *L@NS=!<;D#V!K6s
  222. MV0)$,N#?/RLQT-D"EV[0V0*(![02 R,R\"$%*S%P\&+Z4@!>831S8$MC*S$Pr
  223. M\V"=+8 8 RPJ<   4Y<[X!]A62%FM /W&-;9 I=NT-D"B >T$@,C,J O!9=Nq
  224. M@#(Z^E*P$@.(,<"B @< ('6Y _X1EA5B1CMPCV&=+7#I!ITM@'A *S$P(@/Zp
  225. M4G#I!DZDHR\%*S& & ,L*G   $>7.^ ?80$B9K0#]QC6V0*>%Y4;8S] $ P$o
  226. MN3%VN0,J<=#9 I=TP*("+P"@<R3W)@8RE:97I@,B$X.' _+DQI:'!!4K,; 2n
  227. M X@QP*("!P!@=+D#_A&6%6)&.W"/89TM<'1B:2&F$@>=+<"B C$ H&/$%G8&m
  228. MXE37)E8F!U*$!U<V1E=&IG-)!TA0L1(#UZ@R(@, J:+.&)4R0*<";2Y 8,86l
  229. M=M;F @-S='(K,0!-!Y=NT-D"B >T$@.(,=#F @1F;&%G^E)0*0.&HQ*,*M@:k
  230. MUMD"EV[0V0*(,=#N8V$W%7-3*S'P(04C,G#I!N[LHR\%*S'0V0*7;M#9 H@Qj
  231. MD.UC53=5<E,K,? A!2,R<.D&G2V >$#>.89W4YGLLQ(#^E*P$@-M+C P1R>Gi
  232. M+P5M+D!@QA9VIB\%EW2P$@.(,<"B @< 0'2Y _X1EA5B1CO (6$6(F:T _<8h
  233. MUMD"EV[0V0*(![02 R,RH"\%EV[ /CKZ4C B T@N@- D5)7$1%0D-2(#*S'0g
  234. MV0(L*A $ #I"860@0V]N9FEG=7)A=&EO;CH*0VAE8VL@3&ES=$A0L1(#*S'0f
  235. M[B,C,J O!2LQ</!B^E( 7F$T<V!+8TPQ &]CO!G6V0+",G#I!K01<KD#O!G6e
  236. MV0(C,C!1&$UQL!(#*S%P_F.7;F#X0/I2L!(#[S_0V0*L,!%3.<_BU  $ T# d
  237. MH@(O -!4YE8G5)?&1E8F!R*4!T(4YG:2(P/0$; HP1]D-2;!'V0D3=8%!"\9c
  238. M\2\2L"AQ!@2(,<"B C\ 4-;2%I;&I@,R]H96YO;%%@94QD:6YE(&9\;F,H8&b
  239. M^!&P*/'^ Z- @!@#)$TV(@,7"\6B D, <'(R=7("LC5%1]:E P(" @)R<@("a
  240. M @(" @(" @)R<L*B D$ <'(B=7("LB559M>E P(R12>7YG8& @(" @(" G)Rz
  241. MPJ("20!P<G)T<@*R=23W)M:E W(D]R8& @(" K)4EL>4-D?W B5WQJ("10!Py
  242. M<F)T<@*R9<06=M:E P(" G)R @(" @("$CL"8L06=L:B D4 <')"='("LD64x
  243. M)M>E P(",D4GE^9V!@("PI0V1]=4YE:W @3.<S  !"%RL ($PCZP!P2\/5 Iw
  244. M X ? 8L2-'.0_P-.2\:B D< L =R<D*5!U=V<@(" K)4EN<4UE8& @(5)A?6v
  245. M5D97)@?2!_@1L"B1#@2*2\:B A\  "57-C<'$N:6![)6E@?0$; H4?9!6#+@u
  246. M2A,L*E , " @(" @("!5<V%G93H*(#HQ.B!-96YU($QI<W0*C2!%>&5C=71At
  247. M8FQE($UE;G4*"B Z,3H@365N=2!,:7-T"B Z,CH@)T-35"<*C0I,;V-A;"!#s
  248. <4U0@365N=2!S879E9/D_\ ,$SJ3S(CDK,; 2 SH@r
  249.  q
  250. end
  251. END_UU
  252. BEGIN_RPL example
  253. %%HP: T(3)A(D)F(.);
  254. { { "S" "STD" {
  255. \<<
  256. "Standard Key
  257.  
  258. Left \-> bad key
  259. Right \-> 'right'"
  260. CLLCD 2 DISP 7
  261. FREEZE
  262. \>>
  263. \<<
  264. \>>
  265. \<< "Right Shifted"
  266. CLLCD 2 DISP 7
  267. FREEZE
  268. \>> } } { "R" "REV"
  269. \<< "Reverse Key"
  270. CLLCD 2 DISP 7
  271. FREEZE
  272. \>> } { "G"
  273. GROB 21 8 7C7CF110000110000191B131100001100001100001FF0E11
  274. \<< "Grob Key" CLLCD
  275. 2 DISP 7 FREEZE
  276. \>> } { "F" "TIME"
  277. -40 } { } { "D"
  278. "DIR" { { "S" "IN"
  279. \<< "Inside Dir"
  280. CLLCD 2 DISP 7
  281. FREEZE
  282. \>> } { } { "R"
  283. "BACK"
  284. \<< 0 MENU
  285. \>> } } } }
  286.