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
 limit csetvalue to first cell in row

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
ubdli Posted - 07/04/2014 : 06:05:45 AM
Origin Ver.8.6.0
Operating System: win7

Hey,

is it possible to limit the csetvalue command to only one cell?
What i want to do is to read a value from Col(C) and write it into the first cell in Col(G).
Doing this, i can fastly see with which value my data gets manipulated and can continue with my analysis script refering to this cell.

This is what I have so far:
csetvalue col:=col(G) script:="int ii = Col(D)[1]" formula:="col(C)[ii]" recalculate:=1;

where int ii = Col(D)[1] refers to an intersection, where i want to get my y-value from

I just need the first cell to be filled, but since I have 20k rows in the worksheet, I get this value written down 20k times.
Blows up the project file size if I do this for 100 worksheets...

best regards
4   L A T E S T    R E P L I E S    (Newest First)
ubdli Posted - 07/08/2014 : 04:06:22 AM
oh.. good idea

Thanks a lot!
Kathy_Wang Posted - 07/07/2014 : 9:35:26 PM
quote:
Originally posted by ubdli

Thanks Kathy

The problem hereby is, that when the script is running, the refered cell is empty. So no value is assigned to int ii.

For my calculations I need some values which are not available in the imported files.
My aim was to run the script over all the imported sheets (which always have the same structure) and generates some kind of a form.
So after I manually type in the missing values, the generated sheets automatically (re-)calculate what I want to have.

Thats why I used the csetvalue function and turned the recalculation on.

And as far as I know there is no recalculation with the cell command.



In that case, try still using the csetvalue X-Function but put every calculation in before formula script and leave the formula empty, something like this:


csetvalue col:=col(G) script:="int ii = Col(D)[1]; Col(G)[1] = Col(C)[ii];" recalculate:=1;


Kathy
Originlab
ubdli Posted - 07/07/2014 : 10:18:47 AM
Thanks Kathy

The problem hereby is, that when the script is running, the refered cell is empty. So no value is assigned to int ii.

For my calculations I need some values which are not available in the imported files.
My aim was to run the script over all the imported sheets (which always have the same structure) and generates some kind of a form.
So after I manually type in the missing values, the generated sheets automatically (re-)calculate what I want to have.

Thats why I used the csetvalue function and turned the recalculation on.

And as far as I know there is no recalculation with the cell command.
Kathy_Wang Posted - 07/07/2014 : 02:21:49 AM
Hi,

Why not directly using the Cell function and pass a value into a specific cell?

For example, your script could be modified into something like this:


int ii = Cell(1, 4);
Cell(1, 7) = Cell(ii, 3);


This is actually equivalent to:


int ii = Col(D)[1];
Col(G)[1] = Col(C)[ii];




Kathy
Originlab

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