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
 XYRange::GetBookSheet fails in X-Function.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Alex-qwerty

Russia
Posts

Posted - 02/28/2010 :  08:35:11 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Pro 8.0 SR 6; WinXP SP3.
Method GetBookSheet of XYRange returns FALSE when X is not assigned (or assigned as <autoX>).
For example, if Worksheet has not a column designed as X, then columns are plotted with Row Number at X-axis. If I try to use a Data Selector at that plot and to pass obtained range to my X-Function as input parameter of type XYRange, then my function cannot resolve the names of Book and Sheet of plotted column.

folger

China
6 Posts

Posted - 03/02/2010 :  01:47:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
DataRange::GetBookSheet is used to get book and sheet name of the index-th x range, please refer to :

http://ocwiki.originlab.com/index.php?title=OriginC:DataRange-GetBookSheet

In your case, there is no X range specified in dataplot, so GetBookSheet will not work. X range is considered as valid subrange for regular datarange. However, for XYRange, it makes more sense to use Y. We will fix it with 81SR2, #15157.

As a workaround for now, maybe you can try this :

BOOL	GetBookSheetFromDataPlot(string& strBook, string& strSheet, const DataPlot& dp)
{
	string	strRange;
	dp.GetRangeString(strRange, NTYPE_BOOKSHEET_XY_RANGE);
	return okutil_get_book_sheet_info(&strBook, &strSheet, strRange);
}


Originlab Corp.
There is always something

Edited by - folger on 03/02/2010 02:22:53 AM
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