Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
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.