Click here to Skip to main content
15,910,411 members
Home / Discussions / C#
   

C#

 
QuestionMake a method appear in the properties window Pin
monteiz24-Oct-05 4:18
monteiz24-Oct-05 4:18 
AnswerRe: Make a method appear in the properties window Pin
the last free name24-Oct-05 6:10
the last free name24-Oct-05 6:10 
GeneralRe: Make a method appear in the properties window Pin
monteiz24-Oct-05 22:51
monteiz24-Oct-05 22:51 
QuestionTelephone switch machine Pin
Wail A.Salem24-Oct-05 3:45
Wail A.Salem24-Oct-05 3:45 
QuestionFull path of IsolatedStorageFile Pin
mondolyo7814024-Oct-05 3:34
mondolyo7814024-Oct-05 3:34 
Question[serializable] trouble Pin
Sasuko24-Oct-05 2:46
Sasuko24-Oct-05 2:46 
AnswerRe: [serializable] trouble Pin
Matt Gerrans24-Oct-05 5:53
Matt Gerrans24-Oct-05 5:53 
Questiontry - catch problems Pin
zaboboa24-Oct-05 2:22
zaboboa24-Oct-05 2:22 
Hello,

I have a recursive function call, and I want to cathc the StackOverflowException, in case too many stamps of the function are created. Here is my code to catch the exception:

<br />
public decimal startCalculationOfIRR (double[] intArray, decimal rate)<br />
{<br />
 .<br />
 .<br />
 .<br />
<br />
<br />
try {<br />
	                 rate = this.calcIRR(intArray, MINRATE, MAXRATE, rate, prevTotal, increment, counter);<br />
	              } catch (StackOverflowException) {<br />
	                 return -0.00m;<br />
	              }<br />
 return rate;<br />
}<br />
<br />
<br />
public decimal calcIRR (double[] intArray, string MINRATE, string MAXRATE, decimal rate, double prevTotal, decimal increment, int counter)<br />
{<br />
 .<br />
 .<br />
 .<br />
<br />
 return calcIRR (intArray, MINRATE, MAXRATE, rate, total, increment, counter);<br />
<br />
}<br />
<br />


The problem is that the try catch statement does not seem to catch the error, since the program exists with the StackOverflow Exception. Any ideas?

Thank you
AnswerRe: try - catch problems Pin
AB777124-Oct-05 2:53
AB777124-Oct-05 2:53 
GeneralRe: try - catch problems Pin
zaboboa24-Oct-05 3:25
zaboboa24-Oct-05 3:25 
GeneralRe: try - catch problems Pin
AB777124-Oct-05 3:35
AB777124-Oct-05 3:35 
GeneralRe: try - catch problems Pin
zaboboa24-Oct-05 4:09
zaboboa24-Oct-05 4:09 
AnswerRe: try - catch problems Pin
S. Senthil Kumar24-Oct-05 4:44
S. Senthil Kumar24-Oct-05 4:44 
GeneralRe: try - catch problems Pin
zaboboa24-Oct-05 4:56
zaboboa24-Oct-05 4:56 
GeneralRe: try - catch problems Pin
Tom Larsen24-Oct-05 5:07
Tom Larsen24-Oct-05 5:07 
AnswerRe: try - catch problems Pin
Tom Larsen24-Oct-05 4:46
Tom Larsen24-Oct-05 4:46 
GeneralRe: try - catch problems Pin
zaboboa24-Oct-05 4:55
zaboboa24-Oct-05 4:55 
GeneralRe: try - catch problems Pin
Tom Larsen24-Oct-05 5:03
Tom Larsen24-Oct-05 5:03 
GeneralRe: try - catch problems Pin
zaboboa24-Oct-05 5:32
zaboboa24-Oct-05 5:32 
GeneralRe: try - catch problems Pin
Wjousts24-Oct-05 6:27
Wjousts24-Oct-05 6:27 
AnswerRe: try - catch problems Pin
Daniel Grunwald24-Oct-05 5:18
Daniel Grunwald24-Oct-05 5:18 
GeneralRe: try - catch problems Pin
zaboboa24-Oct-05 7:31
zaboboa24-Oct-05 7:31 
GeneralRe: try - catch problems Pin
Tom Larsen24-Oct-05 8:12
Tom Larsen24-Oct-05 8:12 
AnswerRe: try - catch problems Pin
leppie24-Oct-05 7:01
leppie24-Oct-05 7:01 
AnswerRe: try - catch problems Pin
Daniel Turini24-Oct-05 9:49
Daniel Turini24-Oct-05 9:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.