HP Forums
STO+ adds to front of string, not end - 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: STO+ adds to front of string, not end (/thread-9154.html)



STO+ adds to front of string, not end - brickviking - 09-25-2017 09:14 AM

From the entry line, doing the following combines two strings properly.
Code:

"ABC" "DEF" +

I decided I wanted to stuff these into a variable and add the second bit manually, except I came up against a small problem.

Code:

"ABC" 'J' STO+ @results in the following and an error box:

2: "ABC"
1: 'J'
ErrorBox("STO+ Error", Undefined Name)

So obviously STO+ relies on the variable being initialised already. Fair enough, though I haven't found it mentioned explicitly (yet).

Once I created the variable J I tried this:
Code:

"ABC" 'J' STO+ @results in "ABC"
"DEF" 'J' STO+ @results in "DEFABC"

Why is this? Or do I just have something wrong here? I'm mainly using the AUR at the moment, as I don't have the other two documents (UM/UG) in hard-copy, only in PDF.

(Note): This is related to a program I'll post in another thread.

(Post 96)


RE: STO+ adds to front of string, not end - Gilles59 - 09-25-2017 09:24 AM

Hi

Try 'J' "DEF" STO+


RE: STO+ adds to front of string, not end - pier4r - 09-25-2017 09:49 AM

(09-25-2017 09:24 AM)Gilles59 Wrote:  Hi

Try 'J' "DEF" STO+

same with list. STO<op> is pretty flexible.