free42 3.01 new comparison functions

Post here to share useful tips and tricks, to ask questions about using your DM42 or to report software-related problems
Post Reply
ratwolf
Posts: 26
Joined: Fri Feb 12, 2021 1:00 am

free42 3.01 new comparison functions

Post by ratwolf »

"Implemented new comparison functions, for comparing arbitrary arguments to X
or to zero: X=?, X<?, 0=?, etc."


Where to find, how to use?

Thanks
Thomas Okken
Posts: 910
Joined: Tue May 02, 2017 5:48 pm
Location: United States
Contact:

Re: free42 3.01 new comparison functions

Post by Thomas Okken »

They're in the PRGM sub-catalog: [Shift] [+] [▼] [LOG] [▼] for the comparisons with X, and another [▼] for the comparisons with 0.

In 3.0.3, they're in sub-sub-catalogs of their own: [Shift] [+] [▼] [LOG] [▲], then [LN] for the comparisons with 0 or [XEQ] for the comparisons with X.

Using them should be pretty straightforward. X>? "A" tests if the contents of the X register are greater than the contents of the variable named "A", 0=? IND 12 tests if the contents of the register or variable pointed to by the contents of the numbered register 12 are zero, etc.

UPDATE — On the DM42, instead of [LOG], [LN], and [XEQ], use the 4th, 5th, and 6th menu keys. (Is there a naming convention for those? Should I just say F4, F5, and F6?)
ratwolf
Posts: 26
Joined: Fri Feb 12, 2021 1:00 am

Re: free42 3.01 new comparison functions

Post by ratwolf »

Thank you Thomas.

Got it.

Would be nice if SM would integrate that in the DM42 programming tool

Ratwolf
ratwolf
Posts: 26
Joined: Fri Feb 12, 2021 1:00 am

Re: free42 3.01 new comparison functions

Post by ratwolf »

But why when I manually edit a program on my DM42, see embedded code, because programming tool does not yet support the new comparison commands and replace

21 RCL "Count"
22 RCL "Loop"
23 X>Y?
24 GTO 01

by

21 RCL "Count"
22 x<? "Loop"
23 GTO 01

then the program runs one time. Second time results in insufficient memory and then in general the calculator shows insufficient memory even if I do not run this program but a solver function and I have to reset the calculator to resolve this??? Settings for stack are 4STK!!!

Code: Select all

00 { 113-Byte Prgm }
01▸LBL "PiMC"
02 0
03 SEED
04 STO "Circle"
05 STO "Square"
06 STO "Count"
07 INPUT "Loop"
08▸LBL 01
09 RAN
10 X^2
11 RAN
12 X^2
13 +
14 1
15 X≤Y?
16 GTO 02
17 STO+ "Circle"
18▸LBL 02
19 STO+ "Square"
20 STO+ "Count"
21 RCL "Count"
22 RCL "Loop"
23 X>Y?
24 GTO 01
25 RCL "Circle"
26 RCL÷ "Square"
27 4
28 ×
29 END
Thomas Okken
Posts: 910
Joined: Tue May 02, 2017 5:48 pm
Location: United States
Contact:

Re: free42 3.01 new comparison functions

Post by Thomas Okken »

Yes, the new comparison functions have a memory leak. This was fixed in Free42 3.0.3, but the DM42 firmware does not have that fix yet.

viewtopic.php?f=17&t=2963
ratwolf
Posts: 26
Joined: Fri Feb 12, 2021 1:00 am

Re: free42 3.01 new comparison functions

Post by ratwolf »

O.k. too bad... because these new comparison functions are really helpful
So lets hope that SM will provide an update to free42 3.03 soon and update the programming tool too :-)
whuyse
Posts: 143
Joined: Thu Dec 21, 2017 1:23 pm

Re: free42 3.01 new comparison functions

Post by whuyse »

I just read the release notes of v3.0.3, a couple of nice surprises there, Thomas!
- INDEXing a local matrix, and returning to a previously indexed one when the function returns
- RTNERR that accepts a string, and ERRNO and ERRMSG - these were in my 'err handling improvements' list.
Thanks! Here's to hoping that the SM team finds the time to incorporate these into the DM42 soon.

Cheers, Werner
42S #3249S01123
DM42 #00345
DM41X #01215
Post Reply