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
Compare Two Columns Values
Note:
Only the poster of this message, and the Moderator can edit the message.
Screensize:
640 x 480
800 x 600
1024 x 768
1280 x 1024
UserName:
Password:
Anti-Spam Code:
Format Mode:
Basic
Help
Prompt
Format:
Font
Andale Mono
Arial
Arial Black
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Georgia
Impact
Lucida Console
Script MT Bold
Stencil
Tahoma
Times New Roman
Trebuchet MS
Verdana
Size
1
2
3
4
5
6
Color
Black
Red
Yellow
Pink
Green
Orange
Purple
Blue
Beige
Brown
Teal
Navy
Maroon
LimeGreen
Forum:
LabTalk Forum
Subject:
Message:
* HTML is OFF
*
Forum Code
is ON
Smilies
Origin Ver. and Service Release (Select Help-->About Origin): Operating System: OriginPro 2021b (64-bit) SR1 9.8.5.204 Hello there, I have a small problem of making conditional statement and execute few lines of code. Following is the code in which I am check values of Col(5) and Col(9) and if they have specific values then setting Col(10) value. But the code does not produce intended output. At the end I should have few 100 and few 200 in Col(9) but I get only 200. Can anyone advice whats wrong here? I would appreciate. Thanks. [blue][i]//Get the ranges of the required columns range ra = [mybk$]acaoasheet$!col(2); range rf = [mybk$]acaoasheet$!col(5); range rl = [mybk$]acaoasheet$!col(9); range r10 = [mybk$]acaoasheet$!col(10); //Initialize col10 with rf r10 = rf; //update the r10 values as per logic below if ((rf==0) && (rl=="UP")) { //r10 = 0.6206*ra+0.4007; r10 = 100; } if ((rf==0) && (rl=="DN")) { //r10 = 1*ra; r10 = 200; }[/i][/blue]
Check here to subscribe to this topic.
The Origin Forum
© 2020 Originlab Corporation
Snitz Forums 2000