Post Reply 
Command needed for striping brackets
02-21-2021, 11:10 PM
Post: #7
RE: Command needed for striping brackets
(02-21-2021 03:51 PM)Han Wrote:  Well, here is a screen capture:



Can you provide a screen capture of yours? In your screen capture, include the following commands:
Code:

purge(r);
r:=[1.2,2.3,3.4];
r(1)
r(2)
r(3)
--------------------------

I don't see your posted example have anything to do with the
case I posted about. My post clearly display the need of a command
to strip the brackets from a numerical enclosed in brackets. Your
example do not use a command to strip these brackets. Instead
it uses a store operation that stores a list (or vector list) that can
have one or more elements in it. If looking in the memory, the list
(or vector list) are stored as a list (or vector list) - as you did write it
in the Primes command line. Afterwards you can call by indexing
every single element from this stored list, and so it is striped - and
that's what you do in your example.
Yea, storing and calling the element that way, it will land on the Primes
screen striped without the brackets. Again, what you did here are
calling by indexing a list element from a stored list of elements.
This will strip the brackets. I knew this method in forward. But it had
nothing to do with my post concerning the need of a dedicated
command to strip a single bracket enclosed element from its brackets.

Your example method and my post are to be used in different programing situations. There's no equality between these 2 methods.

By the way, referred to my other posted problem concerning storing
individual enlisted numerical values in enlisted variables, both of
same size, so that each variable are stored with its value separated
from list format, has now become possible without running a loop,
after upgrading my Prime software a few days ago. My Prime can now
resemble the HP48 - 50 method of storing variables value.:
{myv1,myv2, myv3}:={1,2,3}

And the problem in this thread also was solved by own help. To me,
below function is not what you wrote in your former thread - "complicated".
It is as simple as can be. And it works, with both {}, [] :

#cas
STRIP(ele):=
BEGIN
LOCAL e1;
e1:=ele;
e1:=convert(e1,DOM_FLOAT);
RETURN(e1);
END;
#end
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Command needed for striping brackets - essen - 02-21-2021 11:10 PM



User(s) browsing this thread: 4 Guest(s)