function %CH

Post here to share useful tips and tricks, to ask questions about using your DM42 or to report software-related problems
Post Reply
Frank.upn
Posts: 9
Joined: Fri May 26, 2017 3:15 pm
Location: Germany

function %CH

Post by Frank.upn »

Hello,

since I often need the function [%CH] I put these on a function key (with Assign - Custom).
Unfortunately, the function key [%CH] does not work.

for example:
500 ENTER
450 F1 [%CH]
>> -25

450 ENTER
500 F1 [%CH]
>> -25

it always comes the result "-25"

Everything is ok with [%CH] from the catalog menu
and also with free42 function key !

Am I doing something wrong ?
Is that only with my device?

regards
Frank

I use Google translation, sorry.
HP 12cp, 17bII+, 28s, 35s, Prime; DM 41L, 42; Sharp 506; Casio 991 DEX
no higher school attendance, no bachelor, no master - but always interested in simple mathematics
Dave Britten
Posts: 137
Joined: Wed Jun 14, 2017 9:27 pm

Re: function %CH

Post by Dave Britten »

When I try your examples, I get -10 for the first one, and 11.111 for the second one.

Do you have a LBL named "%CH" that is causing a conflict? Try doing GTO "%CH". You should see "Label Not Found". If you do have a LBL "%CH", then I would recommend changing its name to avoid conflicts with the Custom menu.
Frank.upn
Posts: 9
Joined: Fri May 26, 2017 3:15 pm
Location: Germany

Re: function %CH

Post by Frank.upn »

Think, that's the solution.

GTO "%CH" comes "label not found",
but I have loaded the program "Finance" and there is a label "%CHG" with sub-label "%CH".
There will be a conflict!

Many thanks for the help.
HP 12cp, 17bII+, 28s, 35s, Prime; DM 41L, 42; Sharp 506; Casio 991 DEX
no higher school attendance, no bachelor, no master - but always interested in simple mathematics
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: function %CH

Post by Thomas Okken »

The %CHG routine creates a menu of variables (VARMENU) with an entry %CH, but as you saw, that is not a label, and so, it should not interfere with the %CH function in the CUSTOM menu. Just make sure you assign %CH in the CUSTOM menu, not %CHG, and when you want to use it, make sure you really are in the CUSTOM menu, not in the menu created by %CHG. You can tell the difference by pressing and holding the %CH menu key: the VARMENU item will show STO "%CH" or "%CH", while the function will show %CH.
User avatar
Walter
Posts: 3070
Joined: Tue May 02, 2017 11:13 am
Location: On a mission close to DRS, Germany

Re: function %CH

Post by Walter »

Thomas Okken wrote:
Tue Sep 25, 2018 6:23 am
You can tell the difference by pressing and holding the %CH menu key: the VARMENU item will show STO "%CH" or "%CH", while the function will show %CH.
Oh, the subtleties of this language ...
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041
Frank.upn
Posts: 9
Joined: Fri May 26, 2017 3:15 pm
Location: Germany

Re: function %CH

Post by Frank.upn »

Addendum to the information (I hope google translates that correctly):
Thomas Okken wrote:
Tue Sep 25, 2018 6:23 am
... item will show STO "%CH" or "%CH", while the function will show %CH.
press and hold the custom menu button shows "%CH"

I did the following afterwards

1) deleted the %CH function in the Custom menu.
2) clear all programs in the calculator memory.
3) Added the %CH (!) Function in the Custom menu
holding down this key will show "%CH"
4) Clear Variable [CLV] %CH
5) Hold custom button [%CH] now shows %CH.
6) after loading Finance.raw, the Custom button still shows %CH
7) after using [XEQ] >> [%Calc] >> [%CHG] the Custom button will show "%CH" again

I'm not a programmer (just a calculator user), but I'm assuming that loading the finance program will affect the custom menu.

Is not a big problem for me, I delete the custom key [%CH] and use the financial program for the calculation.
Is more complicated, but ok :)
HP 12cp, 17bII+, 28s, 35s, Prime; DM 41L, 42; Sharp 506; Casio 991 DEX
no higher school attendance, no bachelor, no master - but always interested in simple mathematics
StreakyCobra
Posts: 20
Joined: Thu Jun 14, 2018 10:09 am

Re: function %CH

Post by StreakyCobra »

I tried – out of curiosity – if I can reproduce this and indeed the assigned key is changing from %CH to RCL "%CH" after a successful execution of %CALC » %CHG » %CH from the default "FINANCE.raw" program.
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: function %CH

Post by Thomas Okken »

Frank.upn wrote:
Tue Sep 25, 2018 12:16 pm
[...]
3) Added the %CH (!) Function in the Custom menu
holding down this key will show "%CH"
4) Clear Variable [CLV] %CH
5) Hold custom button [%CH] now shows %CH.
6) after loading Finance.raw, the Custom button still shows %CH
7) after using [XEQ] >> [%Calc] >> [%CHG] the Custom button will show "%CH" again

I'm not a programmer (just a calculator user), but I'm assuming that loading the finance program will affect the custom menu.
You are right; this is an aspect of the CUSTOM menu that I had completely forgotten about: when you assign a name to that menu, and a variable with that name exists, but not a label with that name, pressing the menu key performs a RCL.

You could fix the Finance program by changing the %CH variable name to something else, but I think the easiest fix would be to add a %CH program:

00 { 8-Byte Prgm }
01▸LBL "%CH"
02 %CH
03 END

This works because when there is a variable AND a program with the same name, the CUSTOM menu will pick the program.

(The CUSTOM menu only stores the literal text that you entered in the ASSIGN command; the determination of whether that text is interpreted as a label name, a variable name, or a built-in function, is made only when the menu key is pressed, not before, which is why the feedback from that key can change between %CH, RCL "%CH", and XEQ "%CH", without ASSIGN being performed in between.)
Post Reply