HP Forums

Full Version: HP 50g - Purge current variable message
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
The reason is that IDIV2 is a CAS command. I tend to avoid using X as a variable name when possible.
Note also that other commands may use CAS commands internally; e.g. I believe IQUOT & IREMAINDER both use IDIV2.
Reference URL's