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
 Looping across rows and columns

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
shinkei Posted - 03/25/2011 : 6:31:15 PM
Origin Ver. and Service Release (Origin 7.5 SR6):
Operating System: Windows7 64-bit

The following code will let me copy values from worksheets "Data1" and "Data2", to "Data3":
(1)looping across the worksheets,
(2)then across columns in triplicate in each worksheet,
(3)and then finally copying values, from 3 columns at a time on row#12, to Data3 starting with row#1, columns 2,3,4.

start=1; %L="Data3";
loop(ww,1,2){ %K = "Data$(ww)";
for(ii=2;ii<17;ii+=3){
kk=ii;
for(jj=3;jj<15;jj++){
%(%L,jj,start) = %(%K,kk,12);kk++;};
start++;
}}

However, this code will place succeeding values in Data3 down rows instead of looping across columns. There are 5 groups of triplicates each in Data1 and Data2. I want to copy the 5 groups into a series of 5 rows in Data3; Data1 and Data2 should each have their own 5 rows - each should have separate triplicate columns in Data3.

How can this be modified?

thanks
Ginny

1   L A T E S T    R E P L I E S    (Newest First)
larry_lan Posted - 04/02/2011 : 04:49:41 AM
There must be some logic mistakes. I am not quite sure your requirement yet. I think you can debug your script by yourself. For example, type jj, kk and start inside for loop to see which cell you are working on.

Thanks
Larry

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