HP Forums

Full Version: strange irem problem - SOLVED
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.
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.
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
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/
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.
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!!!
Reference URL's