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
 End appending of data

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
gestalt Posted - 12/16/2003 : 4:07:08 PM
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
1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 12/16/2003 : 6:12:33 PM
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

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