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
 limit csetvalue to first cell in row
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ubdli

Germany
10 Posts

Posted - 07/04/2014 :  06:05:45 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Kathy_Wang

China
159 Posts

Posted - 07/07/2014 :  02:21:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

ubdli

Germany
10 Posts

Posted - 07/07/2014 :  10:18:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.

Edited by - ubdli on 07/07/2014 10:20:34 AM
Go to Top of Page

Kathy_Wang

China
159 Posts

Posted - 07/07/2014 :  9:35:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

ubdli

Germany
10 Posts

Posted - 07/08/2014 :  04:06:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
oh.. good idea

Thanks a lot!
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