HP Forums
strange irem problem - SOLVED - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: strange irem problem - SOLVED (/thread-17949.html)



strange irem problem - SOLVED - tgallo - 01-20-2022 09:35 PM

I have a program that runs fine on my calc but doesn't in the virtual calc. I narrowed it down to the irem function.

rem := irem(integer,10);

if I step through the program I check the following values right after this line is executed:

integer = 45
irem(45,10) = 5 <--- just checking irem returns proper value if given non-variable input
rem = integer

what does that even mean? rem should equal 5

Another strange thing is that OCCASIONALLY it works.


RE: strange irem problem - Joe Horn - 01-20-2022 10:08 PM

Just a guess Huh, but does the same problem occur if you name your function something other than 'rem'? In all recent firmware versions, 'rem' is a built-in function, so there might be a name conflict.

EDIT: Another problem: 'integer' is a reserved word. Don't use it as a variable name.


RE: strange irem problem - tgallo - 01-20-2022 10:32 PM

I thought that maybe the problem was with integer so I had already replaced it with integ. I replaced rem with remain and it still fails. I use this code in several games I have written and they worked fine in both the real calc and the virtual up until recently. The thing that has changed is I am using the newest virtual version and I am also using a new PC.

Works fine in the latest firmware on the actual calc.


RE: strange irem problem - pinkman - 01-20-2022 11:29 PM

Could not reproduce it, but maybe you should qualify what’s “last version”.
My virtual Prime version is 2.1.14584 (iOS).

I’m trying to find clues…
Is your program à CAS program?
If yes, is it really needed? Did you check that you don’t share calls between Home and CAS ?
If not, why not using MOD operator?

Regards,
Thibault


RE: strange irem problem - tgallo - 01-20-2022 11:54 PM

version is 2.1.14596

my knowledge of the Prime could be better. I don't know what a CAS program is. I just started writing games for it intermittently since it was released

http://my.tbaytel.net/tgallo/hp%20prime/


RE: strange irem problem - tgallo - 01-21-2022 01:02 AM

I just tried 2 other versions of the Virtual Calc and the same thing happens. Interesting to note though.....when I first open the calc it actually runs fine. Then it will fail any repeated attempts.


RE: strange irem problem - tgallo - 01-21-2022 01:21 AM

I figured it out!!!

I figure since none of the virtual calcs worked ..even the ones that worked before it must be my new PC. It is running Win 11. If I run the calc in Win 8 compatibility mode it works!!!