HP Forums

Full Version: Comments in RPL?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a comment delimiter defined for RPL so that comments can be embedded when editing on the PC?

- John
(09-08-2014 06:14 PM)John R. Graham Wrote: [ -> ]Is there a comment delimiter defined for RPL so that comments can be embedded when editing on the PC?

- John

I believe the @ symbol is will serve the purpose:

<<
@ this is a comment line
DUP DROP
>>

On the calculator, the comments will be removed, if I recall correctly.
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
»
(09-08-2014 07:42 PM)C.Ret Wrote: [ -> ]But if I may have to insert comment directly into a program, I will use a string followed by a DROP command.

Clever!
Thanks
Reference URL's