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
 Poor thread handling of script

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
peter.cook Posted - 10/16/2009 : 05:13:07 AM
Origin Ver. and Service Release (Select Help-->About Origin): 7.5 SR6
Operating System: Vista

Hi,

Recently come across annoying problem with script handling. I have a fairly complex application with alot of macros, OC functions, script sections and involving graph drawing. All the script is sequential and 'correct'. A manifestation of the problem is illustrated below :

run.section(Graph.ogs, HTDRGRaphSetup);
-- dataset creation, plotting etc that takes a couple of seconds
if(exist(HTDRGRaph) == 3) type OK;
type pete;

HTDRGraph should have been created but by the time the exist function is run it hasn't hence OK is not typed out. 'pete' is typed out.

if however, the code

if(exist(HTDRGRaph) == 3) type OK;
type pete;

is appended to the end of the section then it behaves as expected.

I'm not happy with the handling here and not sure how best to deal with this issue so any general advice would be appreciated, thanks.

Cheers,

pete
1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 10/28/2009 : 1:40:16 PM
Without knowing what you have put in the HTDRGRaphSetup section, I cannot precisely answer your question.

Occasionally, Origin asks Windows to do something which we expect will be handled without error or delay and subsequent script may get ahead of expected results. A few workarounds are available.

Sometimes - not always - using the section return helps, as in
bret = run.section(Graph.ogs, HTDRGRaphSetup);
if(exist(HTDRGRaph) == 3) type OK;
You can also pad a little delay in the script to let things catch up:
run.section(Graph.ogs, HTDRGRaphSetup);
sec -p 1; // 1 second delay
if(exist(HTDRGRaph) == 3) type OK;
Or use the queue command:
run.section(Graph.ogs, HTDRGRaphSetup);
queue {if(exist(HTDRGRaph) == 3) type OK;}
doc -u; // This tells Origin to update, AFTER which the script runs

Hope this helps.

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