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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Compress csetvalue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Force

Denmark
9 Posts

Posted - 11/19/2014 :  05:29:14 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 9.1Pro
Operating System: windows7

Hi,

I need to remove several data point from each row if data are missing in a col(14) of the same row number. It works when I use the following:


%A = %H;
window -a %A;
%B = page.active$;
csetvalue col:=[%A]%B!col(3) Formula:="col(14)==NANUM?--:col(3)" recalculate:=0;
csetvalue col:=[%A]%B!col(4) Formula:="col(14)==NANUM?--:col(4)" recalculate:=0;
csetvalue col:=[%A]%B!col(5) Formula:="col(14)==NANUM?--:col(5)" recalculate:=0;
csetvalue col:=[%A]%B!col(6) Formula:="col(14)==NANUM?--:col(6)" recalculate:=0;
csetvalue col:=[%A]%B!col(7) Formula:="col(14)==NANUM?--:col(7)" recalculate:=0;
csetvalue col:=[%A]%B!col(8) Formula:="col(14)==NANUM?--:col(8)" recalculate:=0;
csetvalue col:=[%A]%B!col(9) Formula:="col(14)==NANUM?--:col(9)" recalculate:=0;
csetvalue col:=[%A]%B!col(10) Formula:="col(14)==NANUM?--:col(10)" recalculate:=0;

However, the script buffer is almost full so I am looking for a way to write all the csetvalue-command in a more compressed way. Is there any way to do so?

/Frantz

lkb0221

China
497 Posts

Posted - 11/19/2014 :  11:13:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
for (int ii = 3; ii <= 10; ii++) {
csetvalue col:=col($(ii)) Formula:="col(14)==NA()? NA():col($(ii))" recalculate:=0;
}

Because the target worksheet is already activated, so there is no %A and %B needed for range declaration.
Go to Top of Page

Force

Denmark
9 Posts

Posted - 11/19/2014 :  5:26:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you IKB0221.

That works for me.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000