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
 Origin Forum
 errorproc and error handling
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

paulwel

Netherlands
14 Posts

Posted - 03/19/2001 :  10:20:41 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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


Mike Buess

USA
3037 Posts

Posted - 03/19/2001 :  12:49:18 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

rtoomey

USA
184 Posts

Posted - 03/19/2001 :  4:37:30 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply

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



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