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 for Programming
 Forum for Origin C
 Error codes in try-catch statements
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Alex-qwerty

Russia
Posts

Posted - 10/02/2010 :  09:56:40 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin 8.1 SR3; WinXP

I use try/catch wrapping for calling some NAG functions.
try 
{
    nag_opt_simplex ( ... );
}
catch(int nErr) 
{ 
    printf("nErr = %i \n",  nErr);
}

Where can I find the meaning of error values (nErr)?

Penn

China
644 Posts

Posted - 10/08/2010 :  01:34:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

All NAG functions accept one argument, NagError structure. This structure is used to test whether the NAG function is executing successfully or not. So you can use this structure instead, but not the try/catch. Please refer to this example.

Penn

Edited by - Penn on 10/08/2010 02:57:04 AM
Go to Top of Page

Alex-qwerty

Russia
Posts

Posted - 10/08/2010 :  4:30:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I know about NagError.
But sometimes it is useless. It has correct error code if there was NO exception. Sometimes my project crashes without try/catch statement. Try/catch allows to keep project alive. Try/catch return error code (288), but I don't know the meaning of thise code.
Go to Top of Page

Penn

China
644 Posts

Posted - 10/09/2010 :  02:27:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

It is about the parameter, which is a pointer to Nag_E04_Opt structure. It is not safe to pass the default pointer to this parameter. Please refer to this example on how to call this function.

Penn
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