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
 Variable stability issue on Origin 2018b (Labtalk)
 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/27/2019 :  6:26:29 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

This is a Labtalk code that shows a variable spontaneously modified during the program execution under Origin 2018b :


/* Delete global variables */
  delete -v *;

/* Initialize parameters */
  /* Number of weeks */
  NumberOfWeeks=24;
  /* Variable used to pass the result of a user defined macro */
  Result=0;
  /* Variable used to pass the result of a user R macro */
  gVal=0;

/* test */
  type -c "Step 0, gVal: " $(gVal);
  create TEST -w 2 Week Number;
  type -c "Step 1, gVal: " $(gVal);
  win -cd TEST;
/* end test */


The gVal variable value (0) should not be modified but it is :
gVal = 4.3287

Anyone to reproduce this issue?

The same code executed under Origin 2015 does not show the issue.

Origin Ver. and Service Release : OriginPro 2018b (64-bit) b9.5.5.409
Operating System: Windows 8.1

yuki_wu

896 Posts

Posted - 06/30/2019 :  11:19:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Firstly, we should never touch the system numeric variables. You could use “list v” command to see these variables. This means we should never use “delete -v *;”, which will also delete the system numeric vairables.

We also added this case to our improvement database(ID: ORG-20367), and we will improve the "delete -v *;" command to let user only delete the user-defined variables but keep the system variables in the future version to avoid such issues.

The value of global variables might be changed due to variable name conflicts sometimes. We could rename the variable to avoid such cases.

Regards,
Yuki
OriginLab

Edited by - yuki_wu on 06/30/2019 11:40:32 PM
Go to Top of Page

Tryphon

36 Posts

Posted - 07/03/2019 :  10:03:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Understood. I deleted this command from my program. Thank you for this clarification.
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