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
 Mysterious execution of scripts in a programming t

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
aplotnikov Posted - 03/05/2020 : 06:46:28 AM
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
2   L A T E S T    R E P L I E S    (Newest First)
aplotnikov Posted - 03/05/2020 : 4:42:37 PM
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


Chris D Posted - 03/05/2020 : 3:35:03 PM
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

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