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
 Mysterious execution of scripts in a programming t
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

aplotnikov

Germany
169 Posts

Posted - 03/05/2020 :  06:46:28 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2020 SR0 (64-bit) 9.7.0.185
Win10 Pro

Hello,

I'm trying to execute a script from a programming tab of a TextButton-type UIM object. The script is the following:
...
loop(...) {
  ...
  switch(...) {
    case 1:
      ...
      break;
    case2:
      ...
      break;
    ...
    case n:
      ...
      FaultyCommand;
      ...
      break;
    case n+1:
      ...
      break;
  } //end of switch
  ...
} //end of loop

Each time I'm trying to run the script, Origin crashes completely - without any error message! But if the "FaultyCommand" is commented out, everything works fine. The particular faulty command can be different - usually any loose dataset operation (resizing, reversing, etc.) using standard methods for dataset-type objects. But the most intriguing (or better to say, annoying) thing is, that this command should not be executed at all during this particular script run!!! The switch value in the loop when the program crashes is not equal to n and cannot take this value during the whole script execution!!! What is the reason for such script behavior? Is it possible to avoid the influence of a non-executing code on the execution?

I would appreciate some help to overcome this obstacle.

Regards,
Alexei

Chris D

428 Posts

Posted - 03/05/2020 :  3:35:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Well it is very hard to know what is causing the problem.

I know you shouldn't have to do this but have you tried using:

if (...)
  ...
else if (...)
 ...
else if (...)
 ...

To overcome the issue?


Thanks,
Chris Drozdowski
Originlab Technical Support
Go to Top of Page

aplotnikov

Germany
169 Posts

Posted - 03/05/2020 :  4:42:37 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Chris D

Well it is very hard to know what is causing the problem.


Hi Chris,

Thank you for your prompt reply.

The problem has been solved: the amount of code was too large and possibly caused an overflow. After a thorough revision I reduced the script implementing code fragments as corresponding functions in "ProjectEvents". Now everything works fine.

Seems, Origin has certain undocumented limitations on scripts in programming tabs...

Regards,

Alexei


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