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
 Forum for Origin C
 Try, throw, Catch oddity

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
rlewis Posted - 06/12/2006 : 5:42:54 PM
Origin Version: 7.5Pro-SR6
Operating System: Win-XP-PRo-SR2

Thre following code snippet illustrates an oddity

bool MyFunc(int i)
{
try
{
if(foo(i)==true)
{
SetDataDisplayText("true");
return (true);
}
return (false);
}
catch (int ierr)
{
if(ierr==1)
{
SetDataDisplayText("false");
return (false);
}
SetDataDisplayText("Unknown");
return (false);
}
}
bool foo(int i)
{
if(i<=0) throw (1);
return (true);
}


The command "Myfunc(0)" behaves as intended ... Prints "false"
However when "MyFunc(1)" is called "return (true)" does NOT terminate the program and code in the Catch block is executed and "Unknown " is printed ...

Does anyone have any ideas ??
1   L A T E S T    R E P L I E S    (Newest First)
andrew Posted - 06/13/2006 : 4:10:54 PM
Thank you for reporting the bug!

This has been trackered as #8750.

Edited by - andrew on 06/13/2006 5:12:09 PM

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