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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Looping across rows and columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

shinkei

USA
1 Posts

Posted - 03/25/2011 :  6:31:15 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

larry_lan

China
Posts

Posted - 04/02/2011 :  04:49:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Edited by - larry_lan on 04/02/2011 04:50:05 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000