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
 Loop stops after the first 30 values

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
cougar2 Posted - 01/30/2004 : 08:33:23 AM
Hi everyone,

I´m using Origin 7 to process a number of worksheets named A115021Nr0334 to A115021Nr0402 (i.e. 70 or more).
My labtalk script is supposed to just copy the value of cell No. 124 in column C to another existing worksheet named data1. However this loop always stops after the 30th cell and the same happens when taking a for loop:

loop (num, 334, 402) {
copy -b 124 A115021Nr0$(num)_C data1_D -b $(num-333) -e $(num-333);
};

Until cell No. 30 it works well (and No. 30 or 31 do exist).
Can anybody help?

4   L A T E S T    R E P L I E S    (Newest First)
cougar2 Posted - 02/02/2004 : 07:45:49 AM
Mike, it works perfectly, thanks again so much.

Mike Buess Posted - 01/30/2004 : 12:43:55 PM
There are a number of ways to do that. This method assumes you use the default column names...

col number: 1 2 3 4 5 ...
col name: A B C D E ...

Columns are created in data1 as they are needed.
%P=A115021Nr0;
%W=data1;
if( exist(%W_D)==1 ) del %W_D; // delete data1 col(D) if it exists
m=3; // initialize data1 col #
n=1; // initialize data1 row #
loop (num,334,402) {
if( mod(num-334,23)==0 ) {
%W!wks.addCol(); // create col
m++; // increment col #
n=1; // reset row #
};
%W!cell(n,m)=%P$(num)_C[124];
n++; // increment row #
};


Mike Buess
Origin WebRing Member
cougar2 Posted - 01/30/2004 : 10:37:44 AM
Thanks a lot Mike, it works fine now.
Please let me ask another question which connects to the first problem. Can I instead of just copying the values into one column in data1 also copy them into separate columns (23 of them each into one column and then jump to the next in data1 and copy the next 23 and so on)?

Mike Buess Posted - 01/30/2004 : 09:27:56 AM
It probably stops because data1 has only 30 rows (default # for new worksheets). Also, there are easier ways to copy cells...

set data1 -er 402; // make sure that data1 has enough rows
loop (num,334,402 ) {
data1_D[num-333]=A115021Nr0$(num)_C[124];
}

Mike Buess
Origin WebRing Member

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