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
 X-function in a 'for' 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
Guest285 Posted - 05/08/2016 : 03:47:22 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.5.0 sr1b161
Operating System:windows
I am trying to parse a raw data file of three columns: the first two are x and y values and the third is filled with segments of 0 and 1 values.
I want to copy parts from the first two columns using the third column's values to discriminate which parts to copy.
I use a 'for' loop with the 'copydata' x-function inside, however, when i run the script the result i get is that the copydata function only executes once (although it should be executed several times).
What do i do wrong and how can i solve this problem?
3   L A T E S T    R E P L I E S    (Newest First)
jasonzhao Posted - 05/09/2016 : 04:26:16 AM
Hello,

It seems that the script is related to some specific datasheet, would you please send your OPJ to tech@originlab.com?

Best regards!
Jason
OriginLab Technical Service
Guest285 Posted - 05/09/2016 : 03:16:16 AM
Int airtime=600;
Int basetime=120;
Int peak_num=1;
Range vv=col(N); //that the third column
For (ii=2;ii<=vv.getsize();ii++) {if (col(N)[ii]==100000&&col(N)[ii-1]==0) {copydata irng:=col(A)[ii-basetime]:col(B)[ii+airtime] orng:=R!wcol($(peak_num));peak_num+=2}}
jasonzhao Posted - 05/09/2016 : 02:27:03 AM
Hello,

Would you please paste your script here for test?
May be you need to active the specific windows before executing X functions by using command in the loop:

win -a BookName;


Best regards!
Jason
OriginLab Technical Service

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