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
 %1 local variable modified by xop (in a macro)

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
Tryphon Posted - 06/21/2019 : 11:29:42 AM
Hello,

I get a weird behavior using xop with Labtalk (Origin 2018b). I execute a large Labtalk program (ogs file) which calls the following definition:


Def macroTest {
/* Perform a multiple linear regression to compute the residuals */

/* ... some commands not shown here ... */

  tree mrGUI;
  xop execute:=init classname:=MR iotrgui:=mrGUI;
  mrGUI.GUI.InputData.Range1.X$=col(WEEK);
  mrGUI.GUI.InputData.Range1.Y$=col(%1);
  /* to see the whole tree node, use command "mrGUI.=" after running this example */
  mrGUI.GUI.Quantities.Parameters.ConfInterval = 1;
  mrGUI.GUI.Quantities.Statistics.ReducedChiSq = 1;
  mrGUI.GUI.ResAnalysis.Stad = 1;
  mrGUI.GUI.Residuals.Graph3 = 1;
  mrGUI.GUI.Residuals.Graph4 = 1;
  mrGUI.GUI.Residuals.Graph5 = 1;
  mrGUI.GUI.Residuals.Graph6 = 1;
  mrGUI.GUI.Residuals.Graph7 = 1;
type -c "Unmodified value: " %1;
  xop execute:=report iotrgui:=mrGUI;
type -c "Modified value: " %1;
  xop execute:=cleanup;

/* ... some commands not shown here ... */

}


The first type command returns original content of %1 ("VM")
Unmodified value: VM
The second type command returns an unexpected content of %1
Modified value: C:\Program Files\OriginLab\Origin2018b\ReportPartial

Hence, %1 is modified during the macroTest execution!

The same program executed under Origin 2015 does not show up this issue.

Any idea to solve this ?

Thank you.

Origin Ver. and Service Release : OriginPro 2018b (64-bit) b9.5.5.409
Operating System: Windows 8.1
3   L A T E S T    R E P L I E S    (Newest First)
Tryphon Posted - 06/27/2019 : 5:55:11 PM
Hello,

I think I isolated a code portion that arises a stability issue on some variables during Labtalk macro execution. I open a different topic.

Thank you.
Tryphon Posted - 06/27/2019 : 09:13:04 AM
When several macro definitions are nested (macro1 calls macro2 which calls macroTest), all existing %1 and %4 local variables (placeholders) are set to this unique value ("C:\Program Files\OriginLab\Origin2018b\ReportPartial"), i.e. macro1 and macro2 have their %1 and %4 set to this value. Curiously %A is also affected.

I cannot see any logical relation between xop command and %1, %4 or %A.

Of course, using string str$="%1" solves the problem for a while... but all macro definitions have to be revisited. Big work.

Thanks.
cpyang Posted - 06/21/2019 : 9:38:45 PM
It is hard to know what happen without a simple case with full details.
Can you put %1 into a local string variable so it is used only once?

string str$="%1";

at the beginning and then refer to str$ later in the code with %(str$)


CP



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