Permanent unexitable CUSTOM menu

Post here to share useful tips and tricks, to ask questions about using your DM42 or to report software-related problems
Post Reply
keithdalby
Posts: 564
Joined: Mon Apr 24, 2017 8:38 pm

Permanent unexitable CUSTOM menu

Post by keithdalby »

keithdalby wrote:
Sat Dec 30, 2017 8:07 pm
I wish there was an option to make the CUSTOM menu the permanent menu, so that one can press EXIT lots and lots of times without exiting out of the CUSTOM menu, unlike the current behaviour.
Figured it out using a program named CUSTOMM for the KEYX MENU allocations and KEY 9 XEQ CUSTOMM. Replacing EXITALL in programs with XEQ CUSTOMM did the trick (mostly, some odd behaviour with one program but I can figure it out).

What's the difference between GTO and XEQ?
grsbanks
Posts: 1122
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: Permanent unexitable CUSTOM menu

Post by grsbanks »

XEQ is basically the same thing as a "GOSUB". Once a "RTN" instruction is encountered, execution resumes at the line following the XEQ instruction.
There are only 10 kinds of people in the world: those who understand binary and those who do not.
keithdalby
Posts: 564
Joined: Mon Apr 24, 2017 8:38 pm

Re: Permanent unexitable CUSTOM menu

Post by keithdalby »

Isn't that the same as GTO though?

Edit to add: everything I've read says that GTO and XEQ affect the behaviour of RTN, where RTN following a GTO with no prior XEQ ends the program, but a RTN following an XEQ returns, as expected to the next line following the XEQ; HOWEVER, I'm sure I've written programs. Using GTO and RTN that have worked as if XEQ were used. Not 100% sure and I could be wrong, but fairly sure.

Or maybe that's why my CUSTOMM menu is behaving strangely with my CONST program.......... I shall investigate later, thank you grsbanks
User avatar
Walter
Posts: 3070
Joined: Tue May 02, 2017 11:13 am
Location: On a mission close to DRS, Germany

Re: Permanent unexitable CUSTOM menu

Post by Walter »

That sounds like very basic misunderstandings. Here are the facts:

As grsbanks wrote, XEQ calls a subroutine and RTN returns from this subroutine.

GTO, on the other hand, is a command which shall be forbidden in structured programming. It simply jumps around. No return address is stored, so a RTN can't find a return address to return to (puns intended).

I sincerely hope you once learned a programming language not only by doing.
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041
keithdalby
Posts: 564
Joined: Mon Apr 24, 2017 8:38 pm

Re: Permanent unexitable CUSTOM menu

Post by keithdalby »

Walter wrote:
Thu Feb 15, 2018 11:05 am
I sincerely hope you once learned a programming language not only by doing.
Your concern for me is touching, Walter, I appreciate the sentiment :).
User avatar
Walter
Posts: 3070
Joined: Tue May 02, 2017 11:13 am
Location: On a mission close to DRS, Germany

Re: Permanent unexitable CUSTOM menu

Post by Walter »

keithdalby wrote:
Thu Feb 15, 2018 11:10 am
Walter wrote:
Thu Feb 15, 2018 11:05 am
I sincerely hope you once learned a programming language not only by doing.
Your concern for me is touching, Walter, I appreciate the sentiment :).
You're welcome.
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041
keithdalby
Posts: 564
Joined: Mon Apr 24, 2017 8:38 pm

Re: Permanent unexitable CUSTOM menu

Post by keithdalby »

keithdalby wrote:
Thu Feb 15, 2018 10:46 am
I'm sure I've written programs using GTO and RTN that have worked as if XEQ were used
I was mistaken, I've written no such programs
Post Reply