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
 SOLVED - Filter seems to skip rows

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
whylabtalkwhy Posted - 03/17/2016 : 09:11:00 AM
Origin Ver. and Service Release: Origin 9.1.0 (64-bit) b215 (Home Use)
Operating System: Windows 8.1

Hi,

I am running a fairly simple program to filter out all data points greater than a certain x-Value from a worksheet with only two columns (X and Y, about 5000 rows). However, if I run the program one time, Origin seems to skip about 10 data points. If I run it a second time, those points disappear as well. I would like it to filter everything out on th first run.

Here is my program:

xm = 20000;

get col(A) -e numpoints;
for(ii = 1 ; ii <= numpoints ; ii++)
{ range xx = col(A)[ii];
if(xm-Col(A)[ii]<=0){
mark -d xx;
}
}

I would appreciate your help.
Cheers,
whylabtalkwhy
1   L A T E S T    R E P L I E S    (Newest First)
whylabtalkwhy Posted - 03/17/2016 : 09:48:20 AM
Found the solution myself but just in case anybody has the same question in the future.

Deleting a row sets the index of the for loop off, so you need to reset it to the one before and insert ii=ii-1.

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