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
 Origin Object Comments Questions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cdrozdowski111

USA
247 Posts

Posted - 01/19/2014 :  1:40:06 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 9.1 SR1 64-bit/32-bit, Win7 Pro 64-bit, running in VMware Fusion 5.0.4

I have a few questions related to comments for Origin Objects.
1) Based on the code below, it seems that the maximum length of comments for Origin objects is 48K. Is this universal for all Origin object comments?
2) Does the SetComments() method truncate strings that are longer than 48K or throw an error?
3) Does the SetComments() method convert all line endings to CRLF (\r\n) or keep the line endings as the originally are- e.g. just LF (\n)?


//The following is defined in OC_const.h

#define	TEMP_STRING_SIZE		(48 * 1024)		// 48K; after this change SYSTEM_STRING is stll under 100K  


The following function is in fu_utils.c

static bool _is_comment_size_exceed_limitation(int nSize)
{
	/// ML 9/30/3009 QA70-13839 NEED_EVEN_LARGER_TEMP_STRING_SIZE
	//// see buffer size char SYSTEM_STRING::szTemp[TEMP_STRING_SIZE] which is define to 24k used as buffer to read origin object comments
	//return nSize > 24575/*24k-1*/ ? true : false;
	return nSize >= TEMP_STRING_SIZE ? true : false;
	///// end NEED_EVEN_LARGER_TEMP_STRING_SIZE
}

Penn

China
644 Posts

Posted - 01/20/2014 :  04:41:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I am afraid the size you mentioned is not for the length of comments. I have made a simple test, and it is able to set the comments by string with length bigger than 48*1024, and it is also able to get it back.

For your question 3), there should be no conversion.

Penn

Edited by - Penn on 01/20/2014 10:14:21 PM
Go to Top of Page

cdrozdowski111

USA
247 Posts

Posted - 01/20/2014 :  6:58:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Penn,

Thanks for the info.

I came across that function while researching whether there was a limitation for the length of comments. You're testing indicates that there isn't one.

The reason that that function originally caught my eye is because it is used by the Import Wizard when the option to append file name to workbook comments is chosen. Code comments nearby to the function (and the other functions that call it) indicate that at some point, Origin would crash when really big comments were added to pages. So that function (and constant) were put in place to prevent the crash. Alas, that is the only place I've found with such a length check.
Go to Top of Page

cdrozdowski111

USA
247 Posts

Posted - 01/21/2014 :  09:17:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Nevermind... I no longer need to address this :)
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