Author |
Topic |
|
peter.cook
UK
356 Posts |
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
|
|
greg
USA
1378 Posts |
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. |
|
|
|
Topic |
|
|
|