Custom Menu Directories

Post here to share useful tips and tricks, to ask questions about using your DM42 or to report software-related problems
Post Reply
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Custom Menu Directories

Post by whuyse »

How to organize the 18 slots of the Custom Menu?
I don't know about you, but for me, 18 is not enough, so I use slots to mimic 'directories' and add extra pages. A directory is a program that implements a MENU, and returns to the Custom Menu when you press EXIT. We can only return to the first page of the Custom Menu, not to the Up or Down page, so our directories will need to be on that first page. Also, the directories cannot be executed in program mode.

The following program is a simple example of such a directory, that allows working with HMS values.
Putting the name between square brackets is an indication that it's a link to a new menu.

Code: Select all

00 { 100-Byte Prgm }
01▸LBL "[HMS]"
02 CLMENU
03 "HMS/"
04 KEY 1 XEQ 01
05 "HMSx"
06 KEY 2 XEQ 02
07 "HMS-"
08 KEY 3 XEQ 03
09 "HMS+"
10 KEY 4 XEQ 04
11 "→HMS"
12 KEY 5 XEQ 05
13 "→HR"
14 KEY 6 XEQ 06
15 KEY 9 XEQ 09
16▸LBL 10
17 MENU
18 STOP
19 GTO 10
20▸LBL 01
21 X<>Y
22 →HR
23 X<>Y
24 ÷
25 →HMS
26 RTN
27▸LBL 02
28 X<>Y
29 →HR
30 ×
31▸LBL 05
32 →HMS
33 RTN
34▸LBL 03
35 HMS-
36 RTN
37▸LBL 04
38 HMS+
39 RTN
40▸LBL 06
41 →HR
42 RTN
43▸LBL 09
44 CUSTOM
45 END
Assign it to any key in the first page (1-6), and try it out.
Hope you like it.

Cheers, Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
ferni123
Posts: 36
Joined: Tue Aug 08, 2017 11:24 am

Re: Custom Menu Directories

Post by ferni123 »

Dear Werner,

Thanks for sharing. I asked myself the same question and I ended up in a similar solution. I played with a set of programs which adapt the custom menus and are interconnected between them. There is a main program and all the others can call the main program through XEQ 99 (since it is a very easy key combination).

I leave the link below in case you would like to have a look at my solution.

https://gitlab.com/fmartinp/programs42/ ... master/src

Cheers,
Fernando
Last edited by ferni123 on Fri Feb 05, 2021 11:02 pm, edited 2 times in total.
User avatar
Guenter
Posts: 168
Joined: Wed May 24, 2017 6:26 pm
Location: Germany

Re: Custom Menu Directories

Post by Guenter »

That's really smart
Günter
DM42 SN:00004 and SN:00184 -- DM41X SN:00013 and SN:00955
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: Custom Menu Directories

Post by whuyse »

Hi Fernando,
yes I looked at it, you take another approach, reassigning the whole custom menu at every step. I decided against that, because I want the debugging and programming commands (on the Up and Down page of the custom menu in my case) to be permanently available - you can't execute a program while writing or debugging one. And using MENU for the directory pages will give you the option to have as many pages as you want ;-)
Cheers, Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
ferni123
Posts: 36
Joined: Tue Aug 08, 2017 11:24 am

Re: Custom Menu Directories

Post by ferni123 »

Thanks for the answer Werner. At the end, I would say that all is a matter of preferences since we can achieve the same results with both approaches. It is nice to share the different ways on how we solve problems.

In my case, I moved from PROGRAMMABLE menus to CUSTOM menus because I was more comfortable using CUSTOM menu as a quick access menu and the programmable menu for specific menus inside functions. That helped me to define a programming pattern that was suitable for my needs. I expand below a bit the programming pattern that I am personally using in case it would be helpful for someone else:

1) Each program is an abstraction for a module. A module can have 1 or more functions (global labels) inside the program.
2) If a module has more than one global function, the module offers a CUSTOM menu that can be executed simply XEQ the main label of the module. That shows in the CUSTOM menu of the module.
3) If a function needs a specific menu, it uses a PROGRAMMABLE menu.
3) All the modules have a local LBL 99 that run a MAIN program/module (therefore, a MAIN menu)
4) The MAIN module is simply a general CUSTOM menu with access to the functions or modules that I am interested in.

So, in this pattern, the CUSTOM menu is used for accessing functions or module menus (simply new custom menus) and the programmable menu is left for the specific usage of the functions (the subfunctions of the programs like LEN, CONS... ).

Indeed, the limitation is that the CUSTOM menu is limited to 18 elements. Personally, I do not see this as a problem since I like to have simple menus.

I hope that this explanation was not too boring :)

Cheers,
Fernando
User avatar
salvomic
Posts: 186
Joined: Sat Dec 30, 2017 10:09 am
Location: Ragusa, Sicily
Contact:

Re: Custom Menu Directories

Post by salvomic »

for me both approaches are good, thank you for supporting this customisation.
In my opinion, we need also a simple way to save Custom menu to reload it if it would be overwrite to some program, like with the States.

Salvo
∫aL√0mic (IT9CLU) :: DM42 (SN: 00881), DM41X (SN 00523), DM16, HP Prime, 50g, 41CX, 42s, 71b, 15C, 12C, 35s, WP34s -- Free42
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: Custom Menu Directories

Post by whuyse »

Ah, there, Fernando's approach has the edge, as he basically re-assigns the custom menu in every step ;-)
Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
User avatar
salvomic
Posts: 186
Joined: Sat Dec 30, 2017 10:09 am
Location: Ragusa, Sicily
Contact:

Re: Custom Menu Directories

Post by salvomic »

whuyse wrote:
Mon Feb 08, 2021 8:40 am
Ah, there, Fernando's approach has the edge, as he basically re-assigns the custom menu in every step ;-)
Werner
:)
∫aL√0mic (IT9CLU) :: DM42 (SN: 00881), DM41X (SN 00523), DM16, HP Prime, 50g, 41CX, 42s, 71b, 15C, 12C, 35s, WP34s -- Free42
Post Reply