Entering return symbol in a program - Hewlett Packard

This is a discussion on Entering return symbol in a program - Hewlett Packard ; Hi, I'm trying to follow the user guide chapter on programming in USERRPL but I'm getting stuck on entering the return character(red shift . ). The book implies this will just happen if I press the key, but doing so ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: Entering return symbol in a program

  1. Entering return symbol in a program

    Hi,

    I'm trying to follow the user guide chapter on programming in USERRPL
    but I'm getting stuck on entering the return character(red shift . ).
    The book implies this will just happen if I press the key, but doing
    so just creates an extra line. I've tried entering it through the
    chars menu, but that did not show up either. I know this is really
    basic, but I have just spent the last half hour trying to find out how
    to do it. Is the manual just telling me its good formatting to insert
    a new line because it certainly doesn't look that way from the
    program? However, when I run it, it works without the return symbol,
    it works. Still, I'd like to know if that is just a deprecated feature
    or something else which would make it work if I were to make a more
    complicated program.

    The example I'm looking at is on Page 21-22 of the HP 50's user
    guide.

    Thanks for your help!
    - Kyle

  2. Re: Entering return symbol in a program

    On Jul 15, 10:42*am, Kyle Andrews wrote:
    > Hi,
    >
    > I'm trying to follow the user guide chapter on programming in USERRPL
    > but I'm getting stuck on entering the return character(red shift . ).
    > The book implies this will just happen if I press the key, but doing
    > so just creates an extra line. I've tried entering it through the
    > chars menu, but that did not show up either. I know this is really
    > basic, but I have just spent the last half hour trying to find out how
    > to do it. Is the manual just telling me its good formatting to insert
    > a new line because it certainly doesn't look that way from the
    > program? However, when I run it, it works without the return symbol,
    > it works. Still, I'd like to know if that is just a deprecated feature
    > or something else which would make it work if I were to make a more
    > complicated program.
    >
    > The example I'm looking at is on Page 21-22 of the HP 50's user
    > guide.
    >
    > Thanks for your help!
    > - Kyle


    It's okay dude, chill out! The return character is similiar to a
    carriage
    return in a computer (as stated in the manual). The character is
    used to add multiple lines within a string. If you wanted to input
    multiple values at the prompt for a program similar to the one on
    page 21-22 and those values ran off the screen, you could use the
    return character (right shift) and start a second line.

  3. Re: Entering return symbol in a program [compiler/decompiler]

    On Tue, 15 Jul 2008 09:42:59 -0500, Kyle Andrews wrote:

    > I'm trying to follow the user guide chapter on programming in USERRPL
    > but I'm getting stuck on entering the return character (red shift . )
    > The book implies this will just happen if I press the key,
    > but doing so just creates an extra line.


    That's the precise "job description" of a "newline" character --
    to suggest to a "display" function that the next thing in a string
    be displayed on the next line, without otherwise displaying
    any actual graphic, and the "input editor"
    does take the hint and do just that.

    On certain other occasions, under certain options, however,
    some strings will display on a single line anyway,
    with a visible graphic for a "newline,"
    e.g. after setting flag -52
    to ask that string objects on the stack
    be displayed as one line, no matter what,
    so that one can see more objects on the stack,
    without such strings "hogging" more lines of the display
    (this is in the stack display, not in the input editor).

    Besides the above tidbit, however, there's a more fundamental
    fact at work in the entry and editing of programs,
    which is that all your "user level" programs
    are actually instantly "compiled" upon pressing ENTER,
    being digested into internal "binary" objects,
    and as with practically any "compiler,"
    "whitespace" between words can be in any form --
    whether spaces, tabs, newlines, or any combination thereof,
    it's all the same to the compiler, and makes no difference,
    any more than do driving directions, whether written out
    on wide paper or narrow paper, which will get you
    to exactly the same place anyway (if followed

    Although your program is "compiled," the fact that
    you can still see it appear at once on the stack,
    in "plain text" form, and edit it again,
    also in plain text form, conceals the fact that
    all of that plain text has just been "regenerated"
    from the "binary" compiled program by a DE-compiler,
    also automatically and instantly,
    and is not really the same string that you originally entered.

    Hence it is given the internal de-compiler's
    "standard formatting," no matter what you had originally
    typed into the editor yourself, thus wasting any efforts
    at "prettily entering" the text, except for the convenience
    it may give you while you are still originally
    using the input editor, to help you better see
    what you are doing, and thus perhaps to edit more easily.

    So, type newlines between words, while entering/editing programs,
    only for your own immediate value while editing,
    and don't feel sorry that formatting all disappears after editing,
    just like sand castles at the beach

    Full many a gem of purest ray serene
    The dark unfathom'd caves of ocean bear:
    Full many a flower is born to blush unseen,
    And waste its sweetness on the desert air.

    Thomas Gray (1716-1771)
    http://www.bartleby.com/40/285.html

    [r->] [OFF]

  4. Re: Entering return symbol in a program

    In article
    ,
    Kyle Andrews wrote:

    > Hi,
    >
    > I'm trying to follow the user guide chapter on programming in USERRPL
    > but I'm getting stuck on entering the return character(red shift . ).
    > The book implies this will just happen if I press the key, but doing
    > so just creates an extra line. I've tried entering it through the
    > chars menu, but that did not show up either. I know this is really
    > basic, but I have just spent the last half hour trying to find out how
    > to do it. Is the manual just telling me its good formatting to insert
    > a new line because it certainly doesn't look that way from the
    > program? However, when I run it, it works without the return symbol,
    > it works. Still, I'd like to know if that is just a deprecated feature
    > or something else which would make it work if I were to make a more
    > complicated program.
    >
    > The example I'm looking at is on Page 21-22 of the HP 50's user
    > guide.
    >
    > Thanks for your help!
    > - Kyle


    To enter a return character, rather that an actual return,
    press ALPHA before you press return ( ALPHA red-shift . ).

  5. Re: Entering return symbol in a program

    On Tue, 15 Jul 2008 09:42:59 -0500, Kyle Andrews wrote:

    > The example I'm looking at is on Page "21-22" [PDF page 669 of 887]
    > of the HP 50's user's guide.


    Program (deliberately mis-coded, as the manual further explains):

    \<< "Enter a: " {"@:a: " {2 0} V }
    INPUT OBJ\-> \-> a \<< '2*a^2+3' \>> \>>

    Except that where "@" appears above,
    it should actually be a "newline" character.

    In this case, the newline character is within a string,
    so the compiler treats it literally,
    rather than as "whitespace between words."

    Despite the manual's illustration,
    where the newline character is printed as a graphic symbol,
    the editor within the calculator instead just terminates the line
    "invisibly," and continues displaying what follows on the next line,
    as previously discussed. Despite that difference in "what you see,"
    "what you get" is still the same thing, if you have inserted
    the newline character where it belongs.

    Once you have finished editing, however, if you look
    at the stack display, showing the completed program,
    it is likely to show the exact same graphic symbol
    which was printed in the manual,
    pretty much confirming the fact just stated, no?

    > However, when I run it, it works without the return symbol


    Yes, it's a perfect example of something which was completely unnecessary,
    in this case, despite your having been instructed to do it --
    which of course never happens anywhere else in real life

    When I post programs which really do need
    a newline character embedded in a string,
    I often create that character at slight extra programming expense,
    e.g. via 10 CHR, rather than post it in a way which can cause
    such a confusion, or leave any chance for mistake
    when actually entering on the calculator.

    HP wasn't concerned with any chance for mistake in _this_ example, however,
    because it makes no difference whether you insert the newline or not

    By the way, to even more easily "fix" the original program,
    just remove one set of \<< \>> around '2*a^2+3'
    instead of following HP's idea to insert EVAL or \->NUM,
    thus illustrating even more unnecessary suggestions from HP.

    Why the "HP tradition" of bad programming examples in user manuals?
    Perhaps it makes us feel better when we can so easily
    write much better programs ourselves

    [r->] [OFF]

  6. Re: Entering return symbol in a program

    Isn't "Return" (right-shifted "period")
    the same in "Alpha" or non-Alpha mode, on all HP48/49/50?

    [r->] [OFF]

  7. Re: Entering return symbol in a program [compiler/decompiler]

    On Jul 15, 2:17*pm, "John H Meyers" wrote:
    >
    > And waste its sweetness on the desert air.
    >
    > Although your program is "compiled," *the fact that
    > you can still see it appear at once on the stack,


    That reminds me of the time when I was a Nobel poet laureate:

    Lay of the Last Spreadsheet
    Breathes there a man with soul so dead
    Who never to his screen has said:
    "Don't give me that stuff! File Not Found!
    It's in the disk, or on it, for
    I see it in the monitor!"

    www.billstomfoolery.com

    The Rubaiyat of Omar Harddrive
    The moving diskhead writes,
    And having writ,
    Moves on.
    No undos or other ****
    Can call it back to undelete a line:
    Your work is gone -
    Every byte of it.

    www.markwickcrap.org

    Stephen Jobs' Epitaph
    "If I should die, think only this of me -
    That there is some corner of a foreign field
    That is forever Apple."

    www.timeonhands.com

    Bill



  8. Re: Entering return symbol in a program


    "John H Meyers" wrote in message
    newsp.uecr0ywxnn735j@miu.edu...
    > On Tue, 15 Jul 2008 09:42:59 -0500, Kyle Andrews wrote:
    >
    >> The example I'm looking at is on Page "21-22" [PDF page 669 of 887]
    >> of the HP 50's user's guide.

    >
    > Program (deliberately mis-coded, as the manual further explains):
    >
    > \<< "Enter a: " {"@:a: " {2 0} V }
    > INPUT OBJ\-> \-> a \<< '2*a^2+3' \>> \>>
    >
    > Except that where "@" appears above,
    > it should actually be a "newline" character.
    >
    > In this case, the newline character is within a string,
    > so the compiler treats it literally,
    > rather than as "whitespace between words."

    X
    May I add...
    key in ALL of this as is, even the at-signs @

    "\<< \"Byte @ Note that the at-sign used here is a comment command
    Me!\" 1. DISP @ you must preceed " with \ inside a string
    \<< \-> a @ all formatting is preserve inside a string
    \<< '2*a^2+3' @ and that string is here a valid program
    \>> \>> @ and even these comments are preserved for documentation
    \>>" 'PROGRAM.txt' STO

    The above program keeps it's formatting, sice it's stored as text
    to evaluate it:
    PROGRAM.txt STR\->
    or
    PROGRAM.txt OBJ\->

    HP calcs allow you to leave the ending delimiters out:
    "\<< \"Byte
    Me!\" 1. DISP
    \<< \-> a
    \<< '2*a^2+3
    " 'PROGRAM.txt' STO
    --
    Brother-Peter



  9. Re: Entering return symbol in a program

    On Jul 15, 10:42*am, Kyle Andrews wrote:
    > Hi,
    >
    > I'm trying to follow the user guide chapter on programming in USERRPL
    > but I'm getting stuck on entering the return character(red shift . ).
    > The book implies this will just happen if I press the key, but doing
    > so just creates an extra line. I've tried entering it through the
    > chars menu, but that did not show up either. I know this is really
    > basic, but I have just spent the last half hour trying to find out how
    > to do it. Is the manual just telling me its good formatting to insert
    > a new line because it certainly doesn't look that way from the
    > program? However, when I run it, it works without the return symbol,
    > it works. Still, I'd like to know if that is just a deprecated feature
    > or something else which would make it work if I were to make a more
    > complicated program.
    >
    > The example I'm looking at is on Page 21-22 of the HP 50's user
    > guide.
    >
    > Thanks for your help!
    > - Kyle


    I think this is 13 CHR or 10 CHR.

    I had a similar problem years ago. I copied the character from text
    from another source. It shows up as a little black box.


+ Reply to Thread