HP Forums
Comments in RPL? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: Comments in RPL? (/thread-2101.html)



Comments in RPL? - John R. Graham - 09-08-2014 06:14 PM

Is there a comment delimiter defined for RPL so that comments can be embedded when editing on the PC?

- John


RE: Comments in RPL? - Han - 09-08-2014 06:45 PM

(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.


RE: Comments in RPL? - C.Ret - 09-08-2014 07:42 PM

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
»



RE: Comments in RPL? - rprosperi - 09-08-2014 11:30 PM

(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