Author |
Topic  |
|
zskillz
USA
6 Posts |
Posted - 10/11/2003 : 9:22:35 PM
|
so I think that i must just be doing something stupid, but I cannot figure out how to assign a negative numeric value to a variable...
I am using originPro 7.
I have tried something along these lines in the script window...
a=-5; type "($(a))";
and the readout is this
(--)
can anyone please tell me what the annoying little thing that I'm not doing is?
much appreciation!
-Z |
|
cpyang
USA
1406 Posts |
Posted - 10/11/2003 : 10:58:28 PM
|
maybe you have a dataset called "a". Do a list s;
and if you do see A as a dataset, you can delete it by
del a;
CP
|
 |
|
zskillz
USA
6 Posts |
Posted - 10/12/2003 : 12:45:59 AM
|
heh... perhaps it's just too late for me to understand, but does cpyangs' response answer my question... I'm having trouble understanding it.
-Z |
 |
|
cpyang
USA
1406 Posts |
Posted - 10/12/2003 : 06:35:35 AM
|
In script window,
list s
will list all the datasets in the current project. If "a" is one of the datasets, then you cannot use it as a variable, so you must delete this dataset first. You can also check if a variable is defined by
list -v
Once "a" is a dataset, you can make assignment like
a = -5;
but to access its value, you will need to do things like
type "$(a[1])"
CP
|
 |
|
zskillz
USA
6 Posts |
Posted - 10/13/2003 : 11:13:43 AM
|
ah.. thank you.. I was havnig trouble understanding what you said...
I will certainly try doing it again, but that is exactly how I tried assigning and printing the variable... I'm not sure why it wasn't working..
I'll try again and post if need be.
thanks -Z |
 |
|
verrallr@a
Canada
44 Posts |
Posted - 10/14/2003 : 3:09:53 PM
|
If there is a danger that the letter a is already taken as a variable (or dataset), try using something that definitely isn't a variable; e.g. abzz.
abzz=-5; abzz=;
works for me (the second statement simply prints out -5. I use Origin 7 on Windows NT.
R |
 |
|
|
Topic  |
|