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
 Forum for Origin C
 Activate / Access a worksheet by its name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Torschtele

Germany
Posts

Posted - 06/03/2004 :  10:10:26 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello everybody !

How do I access a worksheet by its name ?

E.g., if I want to copy data from a worksheet named "Source" to a worksheet named "Destination" then I have to declare the corresponding datasets by
Dataset(source_wks,0)
Dataset(destination_wks,0)
and then use Data_copy.

How do I get the above entries 'source_wks' and 'destination_wks' from the name of the worksheets ? This is necessary if the worksheets were not created in Origin C (then one always has a line like 'Worksheet wks_name' and one can easily access that worksheet by "wks_name") but existed before a script was started...

I appreciate your help on this,
regards,
Torsten

PS: Sorry for this "trivial" question, but I am rather new to this Origin C language

Mike Buess

USA
3037 Posts

Posted - 06/03/2004 :  10:40:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Torsten,

Just use the names...

string source_wks_name = "Data1";
string destination_wks_name = "Data2";
Dataset dsSrc(source_wks_name,0);
Dataset dsDest(destination_wks_name,0);
Data_copy(&dsDest,&dsSrc);

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