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
 Results log -­> text label (Origin 6.1)

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
Daireann Posted - 12/10/2003 : 1:17:21 PM
Hi!

I'm looking for a way to send, with a labtalk script, the text printed in the results log after a linear fit to a text label I created on the graph.

In Origin 6.1, is it possible to redirect the text output of the type command to a user-created visual object, i.e. a text label? Alternatively, if I put the text in a string variable, is there a more permanent way to display it in my text label than putting the variable (e.g. %Z) in the text dialog box and checking the "link to variables $,%" box in the label control? I don't want the text to change each time I re-open the project...
4   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 12/19/2003 : 3:08:28 PM
Have we decided for certain that there is no way to programmatically access the Results log? I'm interested in saving it to a text file. One can Select All, Copy and even Print the Results log from GUI. LT and/or OC can access all other windows and even the clipboard. Seems like we should be able to do more with the Results log than just hide, show, clear and add to it.

Mike Buess
Origin WebRing Member
rlewis Posted - 12/13/2003 : 6:31:19 PM
After reading Mike's post, I realized that there is no easy way access the contents of the Results Log through LT or OriginC code (at least none that I'm aware of). Perhaps OriginLab couls conside including such a feature in the next version. However, it is feasible to solve Daireann's original problem by editing the the relevant section of the LR.OGS file to store a copy of the output in %Z and then display it in a text label. The following example seems to do what Daireann wants

[MenuLROutput]
SaveRedirection=type.Redirection(16,3); // SDB 1/7/99 REPORT_TO_OUTPUTLOG
type.BeginResults(); /// RKM 12/10/98 v6.0141 REPORT_TO_OUTPUTLOG
%A=Stat.Data$;
if (layer.x.space==1 && layer.y.space==1)
{
type $regression.performLR;
type $regression.EqnForLR;
%Z=$regression.performLR;
%P=$regression.EqnForLR;
%Z=%Z
%P;
}
else
{
type $regression.LRApparent;
type $regression.LREqnApparent;
type $regression.LRmsgApparent;
%Z=$regression.LRApparent;
%P=$regression.LREqnApparent;
%Z=%Z
%P;
%P=$regression.LRmsgApparent;
%Z=%Z
%P;
}

/* Now check to see if there is error data and if it is in plot */
%A=stat.data$;
%B=errof(%A)$;
if (exist(%B)==1)
{
type $regression.UsingWeight;
%P=type $regression.UsingWeight;
%Z=%Z
%P;
}
type;
type $regression.ShortParaHeader1;
%P=" ";
%Z=%Z
%P;
%P=Parameter Value Error;
%Z=%Z
%P;
separator 4;
%Q="------------------------------------------------------------";
%Z=%Z
%Q;
type "A\t$(Stat.LR.A)\t$(stat.LR.Ase)";
%P="A $(Stat.LR.A) $(stat.LR.Ase)";
%Z=%Z
%P;
type "B\t$(Stat.LR.B)\t$(stat.LR.Bse)";
%P="B $(Stat.LR.B) $(stat.LR.Bse)";
%Z=%Z
%P;
%Z=%Z
%Q;
%P=" ";
%Z=%Z
%P;
separator 4;
type;
%P="R SD N P";
%Z=%Z
%P;
%Z=%Z
%Q;
type $regression.ShortParaHeader2;
separator 4;
if (stat.pValue<0.0001) %A="<0.0001"; else %A=$(stat.pValue);
%P="$(Stat.R) $(Stat.SD) $(stat.npts) %A";
%Z=%Z
%P;
type "$(Stat.R)\t$(Stat.SD)\t$(stat.npts)\t%A";
separator 4;
%Z=%Z
%Q;
type.EndResults();
type.Redirection=SaveRedirection; // restore previous redirection.
delete -v SaveRedirection;
label -n LinearFit NewLabel;
LinearFit.text$=%Z;
return 0;

Mike Buess Posted - 12/13/2003 : 10:25:48 AM
If I or Daireann were to use rlewis' method, how could we assign the contents of the Results Log to %Z? I'm using Origin 7.5 so an OC solultion would work for me.

Mike Buess
Origin WebRing Member
rlewis Posted - 12/10/2003 : 3:34:23 PM
If you have a text label named "LabelName" then you can place the desired text in %Z and the command "LabelName.text$=%Z" should then do the trick ....

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