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
 code or script for Set Column Value command

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
zango24 Posted - 08/09/2015 : 2:41:24 PM
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
3   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 08/09/2015 : 11:29:40 PM
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
zango24 Posted - 08/09/2015 : 10:36:15 PM
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
cpyang Posted - 08/09/2015 : 8:54:49 PM
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

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