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
 LabTalk Forum
 Output limitation for the "type" command

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
aplotnikov Posted - 03/03/2018 : 1:17:32 PM
OriginPro 8.6.0 64-bit SR3 b.99
Win7Pro

Hi,

I would like to save an object-attached script as a text file using output redirection to a Notes-windows:
type.notes$=strNotesWin$;
type.rediresct=2;
type %(strObjName$).script$;


However the "type" command outputs only the first 3195 characters of the script string whereas "%(strObjName$).script$=;" works correctly.

Is it possible to overcome this limitation? I would appreciate any suggestion.

Regards,

Alexei

PS. The solution with running of object-attached scripts from additional OGS-files is obvious, however I prefer to avoid it if possible keeping everything in a single OPJ-file.
3   L A T E S T    R E P L I E S    (Newest First)
yuki_wu Posted - 03/06/2018 : 12:39:49 AM
Hi Alexei,

I tested this example in Origin 2017 and Origin 2018 with a UIM button. It works.



Not sure if there is a bug in Origin 8.6 since it is too old. Perhaps you should try our new product:

http://www.originlab.com/index.aspx?s=12&lm=62

Regards,
Yuki
OriginLab
aplotnikov Posted - 03/05/2018 : 08:45:19 AM
Hi Yuki,

thank you very much for the detailed code! The idea is clear (and looks great), however it doesn't work in the case of a text button object (UIM). The tree in the function get_go_LTScript_event does not contain any script node:
Tree tr;
tr = go.GetFormat(FPB_ALL, FOB_ALL, true, true);


Is it a peculiarity of UIM objects?
I would much appreciate for further assistance.

Regards,

Alexei
yuki_wu Posted - 03/05/2018 : 04:03:12 AM
Hi Alexei,

I am afraid that LabTalk has no method to solve this issue. Would you mind trying OC? I put an example below:

typedef bool (*PFN_get_go_LTScript_event)(GraphObject& go, string& strLTScript, int& nEvent);

void PutGraphObjectScriptToNotes(string strGrObjName, string strNotesName)
{
	Layer lay = Project.ActiveLayer();
	GraphObject go = lay.GraphObjects(strGrObjName);
	Note note(strNotesName);
	if (go && note)
	{
		PFN_get_go_LTScript_event pfn = Project.FindFunction("get_go_LTScript_event", "Originlab\\grobj_utils", true);
		if (pfn)
		{
			string strScript;
			if (pfn(go, strScript, NULL))
				note.Text = strScript;
		}
	}
}


Regards,
Yuki
OriginLab

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