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
 How to read long text in embedded Note?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

JRoby

USA
6 Posts

Posted - 04/20/2015 :  7:06:26 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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;
...

Edited by - JRoby on 04/22/2015 02:38:17 AM

Shirley_GZ

China
Posts

Posted - 04/22/2015 :  04:24:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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