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
 Origin Forum
 errorproc and error handling

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
paulwel Posted - 03/19/2001 : 10:20:41 AM
I am trying user error handling using the ErrorProc but can't get it to work.What I do is the following:
1) I open several files named D1, D2, .... D10 using the following script:

for (i=1;i<=10;i+1){
win -t data;
open -w c:\temp\D$(i);
}


This works fine. But when for some reason, one of the files is not present, the script crashes and stops executing. I want the script to continue with the next file. How can I fix that? No matter how I use ErrorProc, it always stops the loop.

thanks
Paul


2   L A T E S T    R E P L I E S    (Newest First)
rtoomey Posted - 03/19/2001 : 4:37:30 PM

Mike's solution is great. It's also the best way to do it in the regular version of Origin.



Another solution would be to perform file checking in the "for" loop using an "if" statement. Unfortunately, the commands required to do this are only available in OriginPro! If you are interested, feel free to contact our Sales Department at sales@originlab.com.



- rtoomey



Mike Buess Posted - 03/19/2001 : 12:49:18 PM
Try opening the file from a separate script section like this:

[Main]
for(i=1;i<=10;i+1) run.section(,OpenFile);

[OpenFile]
win -t data;
open -w c:\temp\D$(i);

If the 'open' command fails it will stop execution of the [OpenFile] section, but the [Main] section will keep running. (The for loop will go on to the next value of 'i'.)

-Mike

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