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
 when to use Dataset or Datarange class?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ahlers01

Germany
Posts

Posted - 05/31/2010 :  4:01:28 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.0 and Service Release 5
Operating System: Win XP Prof.

Again an OriginC-beginner's question:

When I want to manipulate data in a worksheet: is there a rule when it's better to use the Dataset class or the Datarange class?

Or is this an irrelevant question because I do not understand the classes?

Penn

China
644 Posts

Posted - 05/31/2010 :  11:01:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Dataset can be used as a vector, but DataRange can not. DataRange is a combination of full or partial Datasets, that is DataRange can be a column, multiple columns, a block of worksheet, multiple blocks of worksheet, but Dataset can only be a column. From this point, DataRange is more powerful than Dataset, especially when making a plot. A DataRange can hold the X, Y, Z and Error columns together. DataRange is recommended.

You can refer to some examples in this page.

Penn

Edited by - Penn on 05/31/2010 11:28:01 PM
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 06/01/2010 :  5:01:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please be careful when using Dataset and passing it to external DLL like NAG. Dataset maps a column in a worksheet to a vector, without making a copy. By default, worksheet columns are Text & Numeric, so you cannot get a pointer to array of double from it, and if you need to pass it as a reference to a vector or to pass it to external DLL, you need to make a copy into a vector first.


CP
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