Post Reply 
Possible bug with polar_coordinates
07-03-2018, 04:53 AM
Post: #2
RE: Possible bug with polar_coordinates
Hello,

In PPL, the ON key is tested at the begining of each function's execution to see if the user is pressing the ON key and wants to stop execution.
This test is done by checking a 64 bit integer where each bit correspond to one of the calculator keys. If the bit corresponding to the ON key is set, then it means that the ON key is pressed. This integer is maintained by the keyboard interrupt function.

The CAS is inherently a unix program. And it's cancel mechanism works around checking if the ctrl+C signal has been sent. To do this, it uses a boolean variable set to false in the main loop (the one waiting for you to press a key and to react to it). and set to true when the user presses ctrl+c...

The issue here is that CAS does not have a IFERR or similar and does not have a way to "cancel" the ctrl+c signal.


All this being said, what is happening is that your program is running. the user presses ON. The calcualtor ON handling code sets the ON key bit in the keymap to 1 and sets the ctrl+c boolean to true.
the PPL evaluator, which is running detects the ON key. Generates an error. The error is caught by the IFERR and PPL continues evaluation.
when polar_coordinate is called, the CAS detects that ctrl+c is set and generates an error. this error is returned to PPL which continues execution.
When the progam terminates, the ctrl+c boolean is cleared.

Obviously, something needs to be done about this. maybe clearing the ctrl+c boolean when IFERR is called? I need to think about it some more.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Possible bug with polar_coordinates - cyrille de brébisson - 07-03-2018 04:53 AM



User(s) browsing this thread: 1 Guest(s)