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
 LabTalk Forum
 %1 local variable modified by xop (in a macro)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Tryphon

36 Posts

Posted - 06/21/2019 :  11:29:42 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Edited by - Tryphon on 06/21/2019 11:30:17 AM

cpyang

USA
1406 Posts

Posted - 06/21/2019 :  9:38:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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


Go to Top of Page

Tryphon

36 Posts

Posted - 06/27/2019 :  09:13:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

Tryphon

36 Posts

Posted - 06/27/2019 :  5:55:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
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