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
 End appending of data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

gestalt

USA
Posts

Posted - 12/16/2003 :  4:07:08 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I hope this is not answered elsewhere in the forum. I have not had any luck finding examples concerning this. I am having trouble appending worksheets end to begining. For example:

Wrks1
1 1 1
1 1 1

Wrks2
2 2 2
2 2 2

Appending them, the worksheet should read

1 1 1
1 1 1
2 2 2
2 2 2

I have been using the following code, but it seems to behave erratically. The idea is to feed the function up to four worksheets which the function appends and the places in a newly names worksheet.

define cwksapp{

%v=%1;
%q=%2;
%r=%3;
%s=%4;
%t=%5;

worksheet -b %q;
worksheet -d %v;

nrows1=%q!wks.maxRows;
nrows2=%r!wks.maxRows;
nrows3=%s!wks.maxRows;

//copy and append all to %v
//%v is a copy of %q so data does not need duplicated

%r!wks.copy(w);
%v!wks.paste(w,1,nrows1+1);

%s!wks.copy(w);
%v!wks.paste(w,1,nrows1+nrows2+1);

%t!wks.copy(w);
%v!wks.paste(w,1,nrows1+nrows2+nrows3+1);

}

I seem to have some problems. I am wondering if it might be the variable names are getting corrupted by other functions disrupting the variable names. If so, is there a way to declare local and global variables in Labtalk?

Thanks in advance for your help.

Jeff

Mike Buess

USA
3037 Posts

Posted - 12/16/2003 :  6:12:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jeff,

I would try something much simpler...

# append Data2 to Data1
%A=Data1;
%B=Data2;
loop(i,1,%B!wks.ncols) {
copy -a %(%B,i) %(%A,i);
};

Hope that helps.

Mike Buess
Origin WebRing Member
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