Post Reply 
how do you delete a list from a program
08-26-2017, 09:28 AM
Post: #1
how do you delete a list from a program
I tried purge(L1) but it doesn't work.
Any suggestions?
I need to do this as I want to use certain lists in my program but their size may vary depending on various factors, so I need to delete them or make them zero size initially.
Basically I want to do the same as deleting from the list editor, but from a program.
Thanks
-Donald
Find all posts by this user
Quote this message in a reply
08-26-2017, 10:09 AM
Post: #2
RE: how do you delete a list from a program
(08-26-2017 09:28 AM)webmasterpdx Wrote:  I tried purge(L1) but it doesn't work.
Any suggestions?

L1:={} or {}▶L1
Find all posts by this user
Quote this message in a reply
08-26-2017, 08:28 PM
Post: #3
RE: how do you delete a list from a program
L1:={} seems to empty it out alright. So is the reason that purge doesn't work because L1 is a system preassigned variable name?
So purge will work with my own variable names, but for the system ones I need to use the method above.
Is this correct?
Thx
-D
Find all posts by this user
Quote this message in a reply
08-26-2017, 08:46 PM
Post: #4
RE: how do you delete a list from a program
I found out how to do this finally in an obscure post via google.
purge(name) works for CAS variables.
For system builtin variables, use L1:={} to clear out the variable, but the variable itself can't be deleted.
For home user variables, or from a program, you can delete them using DelHVars("name").
This delete command doesn't appear to be documented anywhere. However it works. The quotes are necessary.
Find all posts by this user
Quote this message in a reply
08-26-2017, 09:17 PM (This post was last modified: 08-26-2017 09:21 PM by webmasterpdx.)
Post: #5
RE: how do you delete a list from a program
Here is some more information on HVars and DelHVars()....
http://hpmuseum.org/forum/thread-4048.html

All User Variables are stored in a list called HVars. DelHVars(n) deletes the index into the HVars list (deletes that variable). DelHVars("name"), with the quotes, deletes the HVars variable of that name.
Find all posts by this user
Quote this message in a reply
08-27-2017, 03:54 PM
Post: #6
RE: how do you delete a list from a program
Page 635 of the English manual. Also will be in the on calc help somewhere if you search for it I'm sure.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
08-27-2017, 03:58 PM
Post: #7
RE: how do you delete a list from a program
(08-26-2017 08:46 PM)webmasterpdx Wrote:  This delete command doesn't appear to be documented anywhere. However it works. The quotes are necessary.

You can find the information in the calculator help.
[Image: 36447754030_f29cf909c0_o.png]

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
08-27-2017, 06:45 PM
Post: #8
RE: how do you delete a list from a program
The thing is, you go looking for deleting user variables, so I'm going to look under User Variables....not HVars or DelHVars.....that's called knowing where to look when you know the answer.
When you don't know the answer, you are going to look under User Variables or deleting variables. DelHVars isn't in the command list in the online documentation.....I did figure there might be a command that began with Del... but it isn't there.

So, sure, you can find the documentation when you know the answer, but when you don't, it's not intuitive.

Same with most of the obscure documentation. e.g. Statistics_1Var....I was trying to figure out how H1 was defined. Again, if you know the answer and that there is a section with the app variable definitions in the User manual, sure you can find it, but I looked in the intuitive area.....under the chapter for the Statistics_1Var app....not documented there, so I'm not going to find it.

However, now I know these areas are in the docs, so I should be able to find future obscure documentation as I know where to look.
Find all posts by this user
Quote this message in a reply
08-27-2017, 07:29 PM (This post was last modified: 08-27-2017 07:32 PM by Joe Horn.)
Post: #9
RE: how do you delete a list from a program
(08-27-2017 06:45 PM)webmasterpdx Wrote:  The thing is, you go looking for deleting user variables, so I'm going to look under User Variables....not HVars or DelHVars.....that's called knowing where to look when you know the answer.

That's a good choice for what to search for, because if you press Help, Tree, Search, and type "user variables" into the search box, and check the "Find in content" box, it immediately lands on "HVars", and pressing Next goes to "DelHVars".

Help Tree Search is your friend.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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