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
 Origin Object Comments Questions

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
cdrozdowski111 Posted - 01/19/2014 : 1:40:06 PM
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
}

3   L A T E S T    R E P L I E S    (Newest First)
cdrozdowski111 Posted - 01/21/2014 : 09:17:36 AM
Nevermind... I no longer need to address this :)
cdrozdowski111 Posted - 01/20/2014 : 6:58:36 PM
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.
Penn Posted - 01/20/2014 : 04:41:57 AM
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

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