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
 Origin Forum
 code or script for Set Column Value command
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

zango24

India
Posts

Posted - 08/09/2015 :  2:41:24 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8.6
Operating System: win 7

Hello friends,
I need a help in generic code. I have few columns with some values. I want to do the job:

Let's say on col (A),I would like to do col(A)=((col(A)*2)-1).
I am able to do this by using set column value item. But it's pain to do it manually for several columns. So if you can help me with a code or small script to repeat this job on multi column worksheet it would be a great help.

cheers
Zan

cpyang

USA
1406 Posts

Posted - 08/09/2015 :  8:54:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can use Set Multiple Column Values, which was added to Origin since 9.1.

In such Set Values, you can use

wcol(j) = (wcol(j)*2)-1


CP
Go to Top of Page

zango24

India
Posts

Posted - 08/09/2015 :  10:36:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks mate.
Apart from this I am confused about i and j. What does i and j denote in the general script language???

Like you took this col(j)....does i refers to row??? and j refers to column???

Cheers.
Zan
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 08/09/2015 :  11:29:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
i and j can only be used in the context of the set values dialog, as it is a looping variable. j is to use to indicate column index in a Set Multiple Column Formula situation and in order to use j, you need to use wcol, not col, as the col function takes column name or index in literal number like 1 2 3, but to use a numeric variable, you need to use wcol instead.

CP
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