The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
A Free42 (and HP42S) tricky question
09-24-2020, 11:03 AM
Post: #1
A Free42 (and HP42S) tricky question
      
Hi, all:

I'm creating a simple data entry routine on an HP42S (which I'm trying out on Free42) and I'm having a quite unexpected and puzzling problem. Of course I've searched both the HP42S Owner's Manual and the HP42S Programming Techniques documentation but to no avail, the information I need seems to be found nowhere in them. A fair amount of searching the web has proved fruitless as well, and the many experiments I've tried also didn't succeed, so here you are, perhaps you can provide the required info ...

The thing is, I create an empty matrix and I need the user to enter data in it. I naively thought something like this would work ...

      ... (previous steps)
      NEWMAT
      "Enter coefs..."
      AVIEW
      PSE
      EDIT

      ... (execution continues)

... expecting EDIT to activate the matrix editor, display the first element like 1:1=0.0000, and the editor's menu <- OLD ^ V GOTO ->, and then execution would pause while the editor was activated. The user would then use the functionalities of the editor's menu to enter the elements, reviewing them at leisure, then exiting the editor by pressing EXIT and the program's execution would continue.

My problem is, EDIT displays the first element and the editor's menu but the execution doesn't pause, as I expected, it simply goes on non-stop, the first element changing as the X stack register changes !! I've tried to detect that the editor is active and enter a loop until the user exits it, like this:
      ...
      EDIT
      LBL 00
      FS? 65
      GTO 00

      ... (continue execution)

The idea is that while flag 65 is set, the editor is active, so we loop continuously until the user presses EXIT and the editor ends, flag 65 is clear and execution continues. But of course this doesn't work because the continuous looping doesn't allow the user to do anything within the editor other than pressing EXIT to terminate it.

I then tried to insert a pause PSE within the loop, but it doesn't work either, the program just stops at the first cycle. If I just give up and insert a STOP after the EDIT instruction then the program halts and the user can indeed enter and review/edit the data in the matrix, but upon pressing EXIT the user's left with a halted program, seeing the [ MxN matrix ] in the X register, with no way to display some message prompting the user to press R/S to continue, which can be puzzling to the user and decidedly is less than friendly.

The questions: any ideas ? Is it normal behaviour that EDIT executed as a program instruction doesn't halt the program ? Does a real HP42S do this too (I'm working with Free42) ? Is this documented somewhere ? Is there some workaround that would allow me:

      (a) to have EDIT pause the program while the user enters the data and resume program execution once the user exits the matrix editor

      (b) if not, upon exiting from the editor, at least to be able to display some message to prompt the user to press R/S to continue. ?

If nothing works, I'll refrain from using EDIT as a program line and will implement a generic prompt-and-store each element in a loop, but it would be a pity as the editor very conveniently allows the user to review the elements and go forwards and backwards within the matrix, etc, and the ad-hoc input routine would be much more lengthier and less functional. I can also try to use a program-created custom menu, and call EDIT from some menu option, to see if that would work and be acceptable but still I'd prefer a less cumbersome approach ... Any other options ?

Thanks in advance for your answers and/or comments.
V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
A Free42 (and HP42S) tricky question - Valentin Albillo - 09-24-2020 11:03 AM



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