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
 How to read long text in embedded Note?

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
JRoby Posted - 04/20/2015 : 7:06:26 PM
LabTalk is limited to 3799 characters when reading long, embedded Note text:
string str;
str$ = col(2)[1]$; // Source of embedded Note
str.GetLength()=;
outputs 3799
Must be some defined buffer limit.

If I don't know the name of the Notes Window (I won't in this application), how can I read the full text?
The GetText method of the Dataset reads the cell as empty (Origin 2015SR2).
The GetCell method of the Worksheet has a similar limit to LabTalk:
// This code reports 3799 characters
string ReadNote(string strSh)
{
Worksheet wks(strSh);
string str;
wks.GetCell(0,1,str);
printf("Length : %u\n", str.GetLength());
return str;
}
Oddly, if this function is called from LabTalk, the string is further truncated to 3071 characters.

So, unfortunately, only if I know the name (and stay within Origin C) can I process the full text:
...
Note nt(strNoteName);
string str = nt.Text;
...
1   L A T E S T    R E P L I E S    (Newest First)
Shirley_GZ Posted - 04/22/2015 : 04:24:55 AM
Hi,

Inside Origin, when get text from a cell in worksheet, the length limitation is 3800(including the terminator '\0'), since in most case, we assume the text in a cell should not exceed this limitation, yet embedded Note is an exception, we may consider to improve that later(provide some API to get embedded Note page name).

Originlab Technical Service Team

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