The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 negative variable assignment... help pls.

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
zskillz 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
5   L A T E S T    R E P L I E S    (Newest First)
verrallr@a 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
zskillz 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
cpyang 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 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 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



The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000