[comp.sys.handhelds] strings on 48

silvert@cs.dal.ca (Bill Silvert) (05/12/91)

Is there a way to store strings on the HP48SX without having the system
possibly rewriting them?  If I try to store "00-00" in a string variable
the system stores "0-0".  (Application -- storing serial numbers so that
they are readily available.)
-- 
William Silvert, Habitat Ecology Division, Bedford Inst. of Oceanography
P. O. Box 1006, Dartmouth, Nova Scotia, CANADA B2Y 4A2.  Tel. (902)426-1577
UUCP=..!{uunet|watmath}!dalcs!biome!silvert
BITNET=silvert%biome%dalcs@dalac	InterNet=silvert%biome@cs.dal.ca

edp@jareth.enet.dec.com (Eric Postpischil (Always mount a scratch monkey.)) (05/13/91)

In article <1991May11.213329.1322@cs.dal.ca>, silvert@cs.dal.ca (Bill
Silvert) writes:

>Is there a way to store strings on the HP48SX without having the system
>possibly rewriting them?  If I try to store "00-00" in a string variable
>the system stores "0-0".

The 48 stores strings just fine.  It sounds like you may be entering
'00-00' instead of "00-00".  The former, using apostrophes, is an
algebraic object:  zero minus zero.  It is stored internally with tokens
that represent zero minus zero, and when it is displayed, zero is
displayed as 0.  The latter is a string; it is stored character by
character.  Use quotation marks for strings -- the quotation marks are
blue-shifted on the minus key.



				-- edp (Eric Postpischil)
				"Always mount a scratch monkey."
				edp@jareth.enet.dec.com

silvert@cs.dal.ca (Bill Silvert) (05/13/91)

In article <22625@shlump.lkg.dec.com> edp@jareth.enet.dec.com (Eric Postpischil (Always mount a scratch monkey.)) writes:
>
>>Is there a way to store strings on the HP48SX without having the system
>>possibly rewriting them?  If I try to store "00-00" in a string variable
>>the system stores "0-0".
>
>The 48 stores strings just fine.  It sounds like you may be entering
>'00-00' instead of "00-00".  The former, using apostrophes, is an
>algebraic object:  zero minus zero.  It is stored internally with tokens
>that represent zero minus zero, and when it is displayed, zero is
>displayed as 0.  The latter is a string; it is stored character by
>character.  Use quotation marks for strings -- the quotation marks are
>blue-shifted on the minus key.

I appreciate all the comments I received by email and by Eric's posting.
As a result I am even more mystified.  I was indeed aware of the
difference between single and double quotes, and inspection of the stack
shows that indeed I was working with double quotes.  However, after
having done some other stuff with string manipulations last night, the
handling of minus signs has changed, and I suspect that perhaps I
changed a flag or something like that.  I cannot recall the exact
commands I used, but basically what happened was that I generated a
string like "F1-00-0123" and stored it, but when I recalled it I got
"F1-0-123".  This was repeatable.  I finally edited the strings to replace
the - signs by _ and stored them that way.   But I just went back,
edited the strings by replacing _ with -, and the strings are OK.

I do not recall exactly how I entered the strings originally.  I think I
just typed them in.  But today when I try to type in a string like this
the - sign gets interpreted as a command, so to include the - signs I
have to create the strings without them, then edit them.

I'll try to pin this down, but if anyone can clarify string handling by
the 48 it might help.
-- 
William Silvert, Habitat Ecology Division, Bedford Inst. of Oceanography
P. O. Box 1006, Dartmouth, Nova Scotia, CANADA B2Y 4A2.  Tel. (902)426-1577
UUCP=..!{uunet|watmath}!dalcs!biome!silvert
BITNET=silvert%biome%dalcs@dalac	InterNet=silvert%biome@cs.dal.ca

TDSTRONG%MTUS5.cts.mtu.edu@CUNYVM.CUNY.EDU (Tim Strong) (05/14/91)

>

>Is there a way to store strings on the HP48SX without having the system
>possibly rewriting them?  If I try to store "00-00" in a string variable
>the system stores "0-0".  (Application -- storing serial numbers so that
>they are readily available.)
>--

Are you sure you don't mean '00-00'.  If you store that you get back '0-0'.
However if you store "00-00" you get back "00-00".

If what you want is '00-00' then I have an answer.  Try the following program
on a string:

<< # 5B15h SYSEVAL >>  'ST->NAME' STO

If you run it on "00-00" you get '00-00' and you can store it away normally.

Incidentally be careful with this program.  It doesn't do any checking to see
if the string is a valid name so you can get variable names that are difficult
to erase this way unless you realize how to create the name again.

======================================================================
  ___
  I__)  _   _I  _   _   Tim Strong <TDSTRONG@MTUS5.cts.mtu.edu>
  I  \ (_I (_I (_I I    Michigan Tech.    Houghton, Michigan, U.S.A.

======================================================================

ags@seaman.cc.purdue.edu (Dave Seaman) (05/14/91)

In article <1991May13.144544.6606@cs.dal.ca> silvert%biome@cs.dal.ca writes:
>I do not recall exactly how I entered the strings originally.  I think I
>just typed them in.  But today when I try to type in a string like this
>the - sign gets interpreted as a command, so to include the - signs I
>have to create the strings without them, then edit them.

In order to enter the string "00-00", you need to type:

	<blue-shift>"00<alpha>-00<enter>

In particular, if you omit the <alpha> shift before the minus sign, the minus
gets interpreted as an operation instead of a character to add to the string,
resulting in either a "too few arguments" error or a "bad argument type" error,
depending on whether the stack was previously empty.

--
Dave Seaman
ags@seaman.cc.purdue.edu

herman@corpane.uucp (Harry Herman) (05/15/91)

In <1991May13.144544.6606@cs.dal.ca> silvert@cs.dal.ca (Bill Silvert) writes:

>In article <22625@shlump.lkg.dec.com> edp@jareth.enet.dec.com (Eric Postpischil (Always mount a scratch monkey.)) writes:
>>
>>>Is there a way to store strings on the HP48SX without having the system
>>>possibly rewriting them?  If I try to store "00-00" in a string variable
>>>the system stores "0-0".
>>
>>The 48 stores strings just fine.  It sounds like you may be entering
>>'00-00' instead of "00-00".  The former, using apostrophes, is an
>>algebraic object:  zero minus zero.  It is stored internally with tokens
>>that represent zero minus zero, and when it is displayed, zero is
>>displayed as 0.  The latter is a string; it is stored character by
>>character.  Use quotation marks for strings -- the quotation marks are
>>blue-shifted on the minus key.

>I appreciate all the comments I received by email and by Eric's posting.
>As a result I am even more mystified.  I was indeed aware of the
>difference between single and double quotes, and inspection of the stack
>shows that indeed I was working with double quotes.  However, after
>having done some other stuff with string manipulations last night, the
>handling of minus signs has changed, and I suspect that perhaps I
>changed a flag or something like that.  I cannot recall the exact
>commands I used, but basically what happened was that I generated a
>string like "F1-00-0123" and stored it, but when I recalled it I got
>"F1-0-123".  This was repeatable.  I finally edited the strings to replace
>the - signs by _ and stored them that way.   But I just went back,
>edited the strings by replacing _ with -, and the strings are OK.

>I do not recall exactly how I entered the strings originally.  I think I
>just typed them in.  But today when I try to type in a string like this
>the - sign gets interpreted as a command, so to include the - signs I
>have to create the strings without them, then edit them.

>I'll try to pin this down, but if anyone can clarify string handling by
>the 48 it might help.
>-- 
>William Silvert, Habitat Ecology Division, Bedford Inst. of Oceanography
>P. O. Box 1006, Dartmouth, Nova Scotia, CANADA B2Y 4A2.  Tel. (902)426-1577
>UUCP=..!{uunet|watmath}!dalcs!biome!silvert
>BITNET=silvert%biome%dalcs@dalac	InterNet=silvert%biome@cs.dal.ca

TURN ON ALPHA MODE!!!!  Just pressing blue-shift minus to generate the ""
does NOT turn on alpha mode.  Press the "alpha" key twice to lock in alpha
mode.  Pressing it once just does one letter as alphabetic, and then goes
back to normal interpretation.

			Harry Herman
			herman@corpane