Post Reply 
Comments in RPL?
09-08-2014, 07:42 PM (This post was last modified: 09-08-2014 07:47 PM by C.Ret.)
Post: #3
RE: Comments in RPL?
Hi,

On my HP-28S, I use to copy my programs in a paper notebook.
Comments are easy to insert as well as a description of the arguments to use and in which order to put them in the stack.

On the calculator, program readability is poor on the HP-28S screen.

But if I may have to insert comment directly into a program, I will use a string followed by a DROP command.

For example:

Code:
« "* INPUT  1: n     natural number to be tested" DROP
  DUP 0              "Initialize MAX & TOF      " DROP
  WHILE
    ROT DUP 1 >      "Loop until last term      " DROP
  REPEAT
    IF 2 / DUP FP    "Compute next term of seq. " DROP
    THEN 6 * 1 + END "Even:Half  Odd: Triple + 1" DROP
    ROT OVER MAX     "Reset MAX value           " DROP
    ROT 1 +          "Increment TOF             " DROP
  END
  DROP               "Remove last term of seq.  " DROP
  "** OUTPUT  2: MAX altitude  1: Time Of Flight" DROP
»
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Comments in RPL? - John R. Graham - 09-08-2014, 06:14 PM
RE: Comments in RPL? - Han - 09-08-2014, 06:45 PM
RE: Comments in RPL? - C.Ret - 09-08-2014 07:42 PM
RE: Comments in RPL? - rprosperi - 09-08-2014, 11:30 PM



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