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
 Forum for Origin C
 joining columns in worksheets

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
Qiang Posted - 07/22/2003 : 10:29:48 AM
Hi just a quick question,

I have 2 worksheets that come from FFT so FF1 and FF2 are their names. I'd like to extract all the columns from these 2 into an empty worksheet which I initially created. I have OriginPro. the code at the moment is:

void SP_JoinWorkSheets(string WinName)
{
Worksheet wks;
wks.Create("..\..\..\Origin\Resources\empty.otw", CREATE_VISIBLE_SAME);

if(wks.GetPage().Rename(WinName))
printf("Page renamed\n");
else
printf("Failed to rename page\n");

WinName=wks.GetPage().GetName();
printf("name=%s\n",WinName);

wks.joinMode=0;
[wks(WinName)!]wks.join(wks(FF1));
[wks(WinName)!]wks.join(wks(FF2));

}

Hoever it doesn't work. First the joinmode doesn; work and neither do the lines that follow. I get the eror message that function or variable wks not found??!!

thanks

Qiang
2   L A T E S T    R E P L I E S    (Newest First)
Qiang Posted - 07/23/2003 : 05:12:48 AM
Hey,

Thanks a lot! It works alright!

Qiang
easwar Posted - 07/22/2003 : 3:20:19 PM
Hi Qiang,

You are mixing Origin C and LabTalk code here. It is possible to execute LabTalk commands from OC using the LT_execute command, or to set properties of LabTalk objects from OC using the LabTalk.Object.Property method, but it is not possible to just write LabTalk commands inside the OC code.

I would rewrite your function as below:

Easwar
OriginLab.


void SP_JoinWorkSheets(string WinName, string WinName1, string WinName2)
{
// create the new worksheet
Worksheet wks;
wks.Create("..\..\..\Origin\Resources\empty.otw", CREATE_VISIBLE_SAME);

if(wks.GetPage().Rename(WinName))
printf("Page renamed\n");
else
printf("Failed to rename page\n");


// Set joinMode property of wks object in LabTalk
LabTalk.wks.joinMode = 0;

// Build a string of LabTalk command to join the first worksheet
string strCmd = wks.GetPage().GetName() + "!wks.join(" + WinName1 + ")";
// Execute the LabTalk command
LT_execute(strCmd);

// Repeat for second worksheet
strCmd = wks.GetPage().GetName() + "!wks.join(" + WinName2 + ")";
LT_execute(strCmd);
}



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