HP Forums
HP 50g - Purge current variable message - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: HP 50g - Purge current variable message (/thread-19653.html)



HP 50g - Purge current variable message - 2old2randr - 03-13-2023 10:11 AM

I came across an odd issue recently - when calling a program from a test harness that calls the program under test repeatedly with different numbers, a choose box would pop up with the message 'Purge current variable?'. Choosing yes would continue normally but choosing cancel would abort execution with the message 'Mode switch cancelled'.

In debug mode, I could see that this was triggered by an 'IDIV2' instruction.

Does anyone know what the message means? What is meant by a 'mode switch' and why does IDIV2 trigger it? I tried a search but only found references to the CAS and interactions with the variable 'X'. I did, in fact, have a variable 'X' in the test harness that stored the current number but since I am not using any CAS features, I am not sure if it is the same reason.

This is just for my own understanding being new to RPL and the 50g. I worked around the issue by changing IDIV2 to "/ IP".

Sudhir


RE: HP 50g - Purge current variable message - John Keith - 03-13-2023 04:54 PM

The reason is that IDIV2 is a CAS command. I tend to avoid using X as a variable name when possible.


RE: HP 50g - Purge current variable message - cdmackay - 03-13-2023 10:28 PM

Note also that other commands may use CAS commands internally; e.g. I believe IQUOT & IREMAINDER both use IDIV2.