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
 copy cells with txt data

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
coll@inia. Posted - 05/16/2011 : 07:54:20 AM
Origin Ver. 8 wxp

In the same sheet, I am trying to copy the txt content of a row to other column, in case the numeric value in a contigous row exceeds 2.
However, the following script only works for numeric data in cols 9 and 4, but not with txt(label) columns:

nRows=wks.nRows;
for(ii=1;ii<=nRows;ii++)
if(col($(7))[ii]>2) $(Col($(9))[ii])=$(col($(4))[ii];

How can I refer to txt column data to make it work?

Thanks, julio




4   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 05/18/2011 : 10:15:35 AM
Hi,

We have been shipping a LabTalk Scripting Guide with the product from version 8.5.

The material in that guide is available on our wiki site:
http://wiki.originlab.com/~originla/ltwiki/index.php?title=Category:LabTalk_Programming
where there are also additional scripting examples

The guide is available in PDF form here:
http://www.originlab.com/pdfs/Origin85_Documentation/LabTalk_Scripting_Guide.pdf

Easwar
OriginLab
EigenGoofy Posted - 05/17/2011 : 12:07:34 PM
If they really plan to print out those syntaxes with examples and publish as a book, then I would like pre-order it.
coll@inia. Posted - 05/17/2011 : 10:42:51 AM
Thank you Penn!

It is easy when you see it but not before!!!

I will love to have a book with major commands such as those! Will it come some time?. I bet it will be a best seller!!!

Thanks, julio
Penn Posted - 05/16/2011 : 9:33:57 PM
Hi julio,

Some syntax problems exist in your script. For a number to referred to the column, you don't need to use the $ sign, such as col(7) is OK, but not col($(7)). And to get the string in a cell, the $ sign is needed after the cell range. You can refer to this page for more details about string variable and this page for more information about substitution notation.

Your script can be changed like:

nRows=wks.nRows;
for(ii=1;ii<=nRows;ii++)
{
	if(col(7)[ii]>2)
		col(9)[ii]$ = col(4)[ii]$;
}


Penn

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