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 for Programming
 LabTalk Forum
 csetvalue loop

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
RSiertsema Posted - 07/02/2014 : 10:08:33 AM
Origin Ver. and Service Release: 8.5.1 SR2
Operating System: win 7 pro

Hello Originlab!

I am looking for a script that will input numbers from workbook A, sheet 1, column 2 in the 'set column value' of the columns of workbook B. The trouble is that the amount of columns and numbers are variable (though always equal between them), so I need to use a loop.

My try has been the following:

loop(ii, 1, wks.ncols)
{
csetvalue formula:="[workbookA]1!2[$(ii)]*col($(ii))" col:=$(ii) recalculate:=1;
}

Sadly this returns an error. Could you help me with this?

With kind regards,


Reinier
1   L A T E S T    R E P L I E S    (Newest First)
lkb0221 Posted - 07/02/2014 : 2:13:48 PM
Hi,

Function body of SCV cannot recognize range string. You need to put it in the before formula part.
And you need to use wcol instead of col for index.
For example:

loop(ii, 1, wks.ncols)
{
csetvalue col:=$(ii) formula:="r1[$(ii)]*wcol($(ii))" script:="range r1 = [workbookA]1!2" recalculate:=1;
}

Zheng
OriginLab


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