Post Reply 
Delete a global user variable
12-14-2013, 04:26 PM
Post: #1
Delete a global user variable
I've been experimenting with global user variables in the Prime. I have created them using the EXPORT command in a program. Now, when I exit that program, I want to delete that global variable. I have not found a way to programmatically delete it, nor does there appear to be a way to manually delete it, other than go into the program that created it, and manually remove the EXPORT command.

I've also discovered, that if any other program uses that particular deleted global variable, I get syntax errors in those program(s), (I think syntax error is the only error message active right now, because that seems to be the only error I've seen).

Any thoughts?
rcf
Find all posts by this user
Quote this message in a reply
12-14-2013, 07:12 PM
Post: #2
RE: Delete a global user variable
Variables can be accessed by Shift + Toolbox (MEM). Check under User Variables.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-14-2013, 09:17 PM
Post: #3
RE: Delete a global user variable
And to delete a variable, highlight it and press the backspace key.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
12-14-2013, 10:42 PM
Post: #4
RE: Delete a global user variable
Eddie/Han;
I went to the toolbox->User Variables->myuservariable
I hit the backspace key (the key directly under the CAS key?)
It will clear the contents of myuservariable, but does not delete it.
rcf
Find all posts by this user
Quote this message in a reply
12-15-2013, 12:26 AM
Post: #5
RE: Delete a global user variable
When you declare a variable in a source file, what you are really doing is declaring a new globally built in keyword to the system. It can not be removed, because it is not a variable in memory. Rather, it is a function that can take as input an object, and returns that object as output.

Since there is currently no variable/folder/organization akin to the 50g, trying to use it as such is not going to work great at the moment.

Summing up, once your exported object exists, the only way to remove it is to delete it from the source.

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
12-15-2013, 01:50 AM (This post was last modified: 12-15-2013 04:38 AM by Han.)
Post: #6
RE: Delete a global user variable
If the issue is to reduce clutter in the memory browser, just delete EXPORT and they will no longer appear and yet are still kept around. That is, change:

Code:

EXPORT MYVAR1, MYVAR2;

EXPORT PROG1()
BEGIN
  // code here
END;

to

Code:

MYVAR1, MYVAR2;

EXPORT PROG1()
BEGIN
  // code here
END;

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
12-16-2013, 07:00 AM
Post: #7
RE: Delete a global user variable
Hello,

They are a lot of different types of variables in Prime.
non CAS:
- variables ALWAYS have a value.
- you can NOT use a variable which does not exists.
- some variables have enforced types (A-Z, Z0-Z9, L0-L9, M0-M9)
- You have a number of pre-existing global variables which can not be erased (system variables)
- You have a number of pre-existing app specific variables (xMin...) which can not be erased
- you can create user variables by doing varName:=value (or value|>varname). These variables can be erased through the memory manager (backspace)
- you can create new app specific variables (user visible or not) by attaching a program to an app (EXPORTed variables will be user facing and apear in menus). to delete these variables, you need to remove them from the program definition
- you can create new global user variables (user visible or not) by creating a program (EXPORTed variables will be user facing and apear in menus). to delete these variables, you need to remove them from the program definition.


Then you have CAS variables! create them by doing a sto operation and erase them either through purge command or the memory manager.

cyrille
Find all posts by this user
Quote this message in a reply
12-26-2013, 06:48 PM
Post: #8
RE: Delete a global user variable
(12-15-2013 12:26 AM)Tim Wessman Wrote:  When you declare a variable in a source file, what you are really doing is declaring a new globally built in keyword to the system. It can not be removed, because it is not a variable in memory. Rather, it is a function that can take as input an object, and returns that object as output.

Since there is currently no variable/folder/organization akin to the 50g, trying to use it as such is not going to work great at the moment.

Summing up, once your exported object exists, the only way to remove it is to delete it from the source.

Tim;
How might I use a new globally built keyword?. If I am correct, the 50g objects can be most anything. If this is the same concept, Can I put a program in it, or if it is a function, can I input a value, perform a calculation on it, then return that calculated value? You've piqued my interest in what this keyword can do. Any additional information you could provide would be appreciated.
Thanks
rcf
Find all posts by this user
Quote this message in a reply
Post Reply 




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