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
 Origin Forum
 simple (?) Problem with if/else syntax

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
hesaboogie Posted - 03/01/2012 : 10:38:54 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.6
Operating System: WinXP

hi,
i'm new to labtalk etc. so i think the solution to my problem is probably very easy, but i read through the labtalk help and it still won't work.

I want to calculate values (density) in a column depending on the existing of a value in another column (volume). If the sample is a cylinder, i can calculate the density with the mass, diameter and length and the volume column is empty. If not, i can calculate the density by mass/volume. So i tried the "Set values" dialog and put this in the script window:


range rvolume = Col(AE);
range rmass = Col(AA);
range rdiameter = Col(AC);
range rlength = Col(AD);

rcylinder = (rmass / ((rdiameter / 2 ) ^ 2 * pi * rlength * 1000000);
rother = rvolume / rmass * 1000;

if (rvolume > 0) rrho = rother;
else rrho = rcylinder;


then i type "rrho" in the column formula panel, but nothing happens and i don't know why.
What do i do wrong?

thanks,
theresa.
3   L A T E S T    R E P L I E S    (Newest First)
hesaboogie Posted - 03/01/2012 : 11:15:54 AM
Thank you for your answer, i didn't expect the solution to be that easy! ;-)
Drbobshepherd Posted - 03/01/2012 : 11:09:20 AM
After you have your script debugged, check your equations. I think rother should equal rmass/rvolume *1000000.
greg Posted - 03/01/2012 : 10:59:22 AM
There is a parentheses parity problem with the expression

rcylinder = (rmass / ((rdiameter / 2 ) ^ 2 * pi * rlength * 1000000);

Fix that and you should be all set.

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