HP Forums

Full Version: REM Statements on the 33S & 35S
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Hello all.

It's a very nice HP-41 carryover that you can use Flag 10 and EQN to prompt for input on the 32S-II, 33S and 35S. And, I remember seeing something in the 35S Bug List posted here that using EQN as prompts must be followed with some other commands/functions to avoid an error. If I wanted to notate my programs similar to REM statements in BASIC, what coding structure should I follow for the 32SII, 33S and 35S?

Thanks

Edited: 18 Apr 2012, 1:11 a.m.

On the 35S, you could do something like this:

A027 GTO A029
A028 EQUATION WITH A COMMENT
A029 ...

Thanks. Although, I seem to remember that in the HP-35s Bug List that talks about using EQN statements outside of creating mathematical expressions cause the 35S to freeze or crash because EQN will register straight text as a syntax problem. Also, I'm not certain but the bug list also talks about EQN as a prompt without a Pause or R/S will cause the 35S to lock up as well. So, is there some step I need to precede this EQN statement with so that what's in the EQN statement isn't treated as a mathematical equation/expression?

Edited: 18 Apr 2012, 12:52 p.m.

Matt,

This thread discusses the problem with using equations as messages or prompts with the 35s.

Hi Jeff and the rest of the group. Please forgive my asking. Although yes, that post you referred to does explain the issue very well. Because there is so much being said there, I am very overwhelmed at the back and forth information. And, I am very confused as to what to do with flag 10 and when it should be set/cleared. I am also overwhelmed about what to do with the Pause and R/S instructions and where the EQN statement is supposed to occur. All I want to do us use EQN as a REM statement in BASIC. Yes, I understood the discussion but I am very overwhelmed so please, just, in one simple example, how can I use EQN and the CF 10/SF 10 commands, not as a prompt but as a REM statement similar to how REM is used in BASIC?

Edited: 18 Apr 2012, 10:58 p.m.

Hi,

The combination of Flag 10 and EQN is for diplaying messages to the user during execution. REM statements are not usually displayed during execution (just reminders for the coders when looking at code).

If you wish to enter a text in a program and display it on the screen when the program runs.

To display "MESSAGE", enter the following program:

M001 LBL M
M002 SF 10
M003 MESSAGE
M004 PSE
M005 CF 10
M006 RTN

the following keystrokes: (RS = Right Shift (blue), LS = Left Shift (orange))
RS PRGM enter program mode
RS LBL M label program M
LS FLAGS 1 .0 set flag 10
EQN RCL M puts letter M
RCL E puts letter E
RCL S puts letter S
RCL S puts letter S
RCL A puts letter A
RCL G puts letter G
RCL E puts letter E
ENTER finishes line M003
RS PSE pause while calculator displays message
LS FLAGS 2 .0 clears flag 10
LS RTN Returns to start
RS PRGM exits program mode
XEQ M ENTER displays "MESSAGE" for 2-3 seconds

Actually it is an equation that is being entered. The calculator knows to display it instead of evaluating it by setting flag 10, i.e setting Flag 10 tells the calculator that you wish to display text and not evaluate an equation.

To insert text as a traditional REMinder only, do the same as above but do not set Flag 10 (i.e. do not enter lines M002, M004 & M005) and skip over the line as Dave Britten suggested.

Hope this helps,
-B

Edited: 19 Apr 2012, 4:52 a.m.

AH! I see! Thanks for the clarification. Thanks also for the heads up on Dave's comment.

Edited: 19 Apr 2012, 11:29 a.m.

I'll be honest with you. With all the focus on how the EQN function has irregular behaviour, I was severely under the impression that Flag 10 and EQN were joined at the hip. Plus, to structure straight text in an EQN statement and Flag 10's ability to control how the EQN statement operates, I felt as if EQN had to be executed. I also felt that EQN with text in, of and by itself was enough to cause program crashes. It never ocured to me to branch around the EQN step to avoid the !Main! point of EQN actually executing which causes the whole program hanging anomaly.

Edited: 19 Apr 2012, 8:55 p.m.

Just to recap from the thread referenced by Jeff.

  • Displaying a message can cause the program to become un-interruptible, this does not mean it will always hang - it means:
    • if the program terminates normally, it will do so and all will be well - you just can't stop it until it does
    • if you get it into an infinite loop (as most examples in the referenced thread) then it will become infinitely un-interruptible, i.e. hang
  • there is one known way to prevent this and that is to add a PSE after the equation and before the CF 10 (line M004 in my example below)
    • This does mean the message is displayed briefly and not until the user decides to continue by pressing R/S
  • however, I always add this as I may make a mistake and cause an infinite loop and the consequence of an infinitely un-interruptible state will cause MEMORY CLEAR

Hope this clarifies it a bit,
-B

Hi Bart,

Thanks for the clarification. If I recall correctly, if you want the program to actually stop for input, the safe way is to add a STOP after the equation, right? Then you must press R/S stop twice to get going again.

Jeff

Hi Jeff,

Yes, you are right. That effectively terminates the execution of the program (the second R/S starting again at the next line). STOP can be added either after the equation or after the CF 10.