HP35s - problematic INPUT(I) and INPUT(J)



#2

Trying to port a simple (cannot be simpler) BASIC program to "the buggy little beast", such as:

INPUT N
DIM A(N)
FOR I=1 TO N
INPUT A(I)
NEXT I
END

I have faced the situation that the INPUT(I) does not work correctly in a HP35s program. It gives INVALID (I) regardless of the fact that the I points to an existing indirect variable.

The following example describes this situation:

LBL Z
10
STO I
STO (I)
VIEW I
PSE
VIEW (I) // Survives this step, showing (37) 10
PSE
INPUT (I) // Message: INVALID(I)
RTN

When I execute VIEW (I) directly from the keyboard after the program crashes, the program responds with:

(10) 10

which seems to be correct.

Maybe, I missing something here. If not, this may be very serious. Why (37) instead of (10)? Why INVALID(I) and crash for INPUT(I), when VIEW(I) does not cause crash.

The same happens if I is replaced by J in the routine-the response changes into INVALID(J).

Within the Forum I could not trace out if this situation has already been described elsewhere, simply because since HP35s arrived the amount of the posts in the Forum became enormous for me to follow properly as I used to.

To Katie: If this proves to be another bug (though I remember a similar problem with INPUT(I) already described), I feel that I will be ready to teach the beast how to dive in the Adriatic (I am beginning to hate the BLB). Yet another proof that I am not a better person than you.

Edited: 27 Aug 2007, 2:40 p.m. after one or more responses were posted


#3

Nenad, you cannot INPUT (I) to positive values for I, only negative 1 through negative 26 (registers A-Z). The documentation in the manual is in error. INPUT (I) if I=-4 is fine.

#4

Replace INPUT (I) with something like this:

RCL I
R/S
STO(I)

within your loop. This will prompt with the value of I into which the next keyed number will be stored.

The (37) being displayed instead of (10) is a quirk of the remapping of the indirect registers from starting at 0 and the A through Z going to negative numbers. Relatively harmless, but a quirk nonetheless.

INPUT (I) does not work with the numbered indirect registers. Only -1 through -26.

Gene


#5

Replacing the INPUT(I) with something similar to that what Gene suggested was my first thought, but I was rather disappointed that such a simple request cannot be done in a straightforward way. I also couldn't figure out the easiest way to keep the prompt stating "which I" is to be input.

Thank you both, Don and Gene.

#6

I've added this to the bug list.

Even more intereting is that the error only appears if the PSE instruction is included. Leave it out and the program stops and works properly. I.e.

LBL Z
10
STO I
STO (I)
VIEW I

- Pauli


#7

Pauli,

I do not have this behavior in my '2361. Both versions, with and without PSE, work just fine. Maybe a Reset is necessary :-)

Miguel


#8

Now I see: It is VIEW (I), not VIEW I in Pauli's example.

Sorry.

#9

Maybe I am misunderstanding the problem, but I think the problem is in the INPUT (I). Your code does not have that.


#10

Two issues here, one is with the INPUT (I) itself, the other with the VIEW (I).

When you do a VIEW (I) in a program followed by a pause, the prompt shown by VIEW is off by 27 units.

Where it should show "(10)=", it actually shows "(37)=".

It is off by 27.


#11

Not having a good day.

That snip of code now does appear to work correctly, but I have seen the value for (I) be off by 27 units.

As I say, I'm having a bad day.

#12

Sorry guys, I got the program wrong:

LBL Z
10
STO I
STO (I)
VIEW (I)

That is the last line has brackets around the I.

- Pauli


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP35s Program Four Slings Lift Calculation Jean-Marc Biram (Australia) 2 929 12-16-2013, 07:21 PM
Last Post: Jean-Marc Biram (Australia)
  HP35s Calculator Max Rope Tension Program Jean-Marc Biram (Australia) 10 1,842 12-12-2013, 12:03 AM
Last Post: Jean-Marc Biram (Australia)
  INPUT for HP Prime Eddie W. Shore 3 676 11-17-2013, 04:46 PM
Last Post: Michael de Estrada
  HP Prime Tutorial #4 is up (CASE/CHOOSE/INPUT) Eddie W. Shore 1 588 11-15-2013, 07:32 AM
Last Post: Davi Ribeiro de Oliveira
  HP Prime Programming Tutorial #3: WHILE, INPUT, KILL, REPEAT, GETKEY Eddie W. Shore 5 1,014 11-07-2013, 12:25 AM
Last Post: Han
  minor visual bug in INPUT Han 0 401 10-03-2013, 01:13 PM
Last Post: Han
  Input syntax on the Prime Gilles Carpentier 6 921 08-23-2013, 04:31 AM
Last Post: Gilles Carpentier
  Input CAS var on HP Prime Mic 2 553 08-22-2013, 02:29 PM
Last Post: Mic
  HP 85 Serial Interface; INPUT Example? inaki 1 517 06-12-2013, 11:09 PM
Last Post: Paul Berger (Canada)
  HP33E how to input numbers RalfGeiger 6 877 05-07-2013, 02:41 PM
Last Post: Ron Ross

Forum Jump: