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
 Origin Forum
 add textlabel from a textfile
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

J.Stellmacher

Germany
4 Posts

Posted - 02/26/2016 :  12:22:52 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi all,
I'm writing a script in the "script after each file" section of the import wizard which is supposed to automatically plot my imported data. This works fine but I want to add a text label with text from a text file. So I somehow need to save the text from the file to a string, at which point I seem to fail. I don't get the readString command to work. Is there anything special to consider here or is there another way? I have the file path in a string. So the general idea should be: Declare a stdiofile object with this path, read the file and add this to the string I want to display, add the label to my plot, done. right?
regards

Shirley_GZ

China
Posts

Posted - 02/29/2016 :  02:47:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear sir/Madam,

The "script after each file" section of the import wizard only accept the LabTalk script, but the readString command and stdiofile object you used are Origin C functions.

Please try to create a .c file to define the functions you want using Origin C and then call the functions in the "script after each file" section.

Thanks,
Shirley

Originlab Technical Service Team
Go to Top of Page

J.Stellmacher

Germany
4 Posts

Posted - 03/02/2016 :  09:20:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok, I wrote this .c file and it works fine when I start it from the command window in Origin. But when I return the string to my script it seems to be limited to a fixed number(267)of characters. Can anybody tell me why this is and how I can change this or what else to do?
regards
Go to Top of Page

Sophy

China
Posts

Posted - 03/03/2016 :  02:51:10 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hi, J:


I think you were using something like the following in Labtalk

%K=test_set_longtext()$;


In Labtalk help file, it say each String Register can hold up to 260 characters at most(%A-%Y, except for some reserved ones, like %Y, %G etc), yet there is an exception, the %Z, so you may change your code to

%Z=test_set_longtext()$; //%Z can hold longer text
or
strText$=test_set_longtext()$;


Hope it helps.
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