Notice about Fatal Error in 'AmayaMathMLPanel :: OnButton' function

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Notice about Fatal Error in 'AmayaMathMLPanel :: OnButton' function

石井裕介
I tried to compile Amaya.dsw on the System of Microsoft Visual C++ 6.0. but, an error occurred in MathMLPanel.cpp . I'll let you know the detail as follow.
 
The error's detail is
 
..\Amaya\thotlib\dialogue\MathMLPanel.cpp (345) : fatal error C1061 : restriction of compiler : The Level of nesting about block in the program exceeded the maximum
 
The rise of nesting level must be stopped somewhere, I think so.
I can guess the reason that there are too many 'else if' not to be in the permissible range. So, I suggest that All 'else if' should be changed to 'if', or provide a tentative Int variable (for instance , name is 'flag'). The second option is as follow.
 
flag = 0;
 
if(...)
else if...
else if...
else if...
.....
else
    flag = 1;
 
if(flag == 1){ }
 
if(....)
else if...
....
else
    flag = 2;
 
if(flag ==2){ }
... same process repeats
 
 it means that firstly set the value of 'flag' as 0 and 'else if' treatment repeats at constant times (for instance, 100 times) ,and at the last , 'flag' is set to be 1. Next, the value of 'flag' is checked and if it is 1, nothing happens and nesting level finishes and restarts as 'if' and 'else if' repeated at 100 times, Every time 'else if' reached to 100 times , flag ++ and nesting level finishes.As the result, nesting level never exceed maximum.    
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Notice about Fatal Error in 'AmayaMathMLPanel :: OnButton' function

Irene Vatton

On Wednesday 20 June 2007 11:54, 石井裕介 wrote:
> I tried to compile Amaya.dsw on the System of Microsoft Visual C++ 6.0.
> but, an error occurred in MathMLPanel.cpp . I'll let you know the detail as
> follow.
>
> The error's detail is
>
> ...\Amaya\thotlib\dialogue\MathMLPanel.cpp (345) : fatal error C1061 :
> restriction of compiler : The Level of nesting about block in the program
> exceeded the maximum

Okay, I changed "else if" into "else"

>
> The rise of nesting level must be stopped somewhere, I think so.
> I can guess the reason that there are too many 'else if' not to be in the
> permissible range. So, I suggest that All 'else if' should be changed to
> 'if', or provide a tentative Int variable (for instance , name is 'flag').
> The second option is as follow.
>
> flag = 0;
>
> if(...)
> else if...
> else if...
> else if...
> ......
> else
>     flag = 1;
>
> if(flag == 1){ }
>
> if(....)
> else if...
> .....
> else
>     flag = 2;
>
> if(flag ==2){ }
> .... same process repeats
>
>  it means that firstly set the value of 'flag' as 0 and 'else if' treatment
> repeats at constant times (for instance, 100 times) ,and at the last ,
> 'flag' is set to be 1. Next, the value of 'flag' is checked and if it is 1,
> nothing happens and nesting level finishes and restarts as 'if' and 'else
> if' repeated at 100 times, Every time 'else if' reached to 100 times , flag
> ++ and nesting level finishes.As the result, nesting level never exceed
> maximum.

--
     Irène.
-----
Irène Vatton                     INRIA Rhône-Alpes
INRIA                               ZIRST
e-mail: [hidden email]       655 avenue de l'Europe
Tel.: +33 4 76 61 53 61             Montbonnot
Fax:  +33 4 76 61 52 07             38334 Saint Ismier Cedex - France


Reply | Threaded
Open this post in threaded view
|

Re: Notice about Fatal Error in 'AmayaMathMLPanel :: OnButton' function

Martin J. Dürst
In reply to this post by 石井裕介

At 18:54 07/06/20, 石井裕介 wrote:
>I tried to compile Amaya.dsw on the System of Microsoft Visual C++ 6.0. but, an error occurred in MathMLPanel.cpp . I'll let you know the detail as follow.
>
>The error's detail is
>
>..\Amaya\thotlib\dialogue\MathMLPanel.cpp (345) : fatal error C1061 : restriction of compiler : The Level of nesting about block in the program exceeded the maximum
>
>The rise of nesting level must be stopped somewhere, I think so.
>I can guess the reason that there are too many 'else if' not to be in the permissible range. So, I suggest that All 'else if' should be changed to 'if', or provide a tentative Int variable (for instance , name is 'flag'). The second option is as follow.

This needs a small fix.

>flag = 0;
>
>if(...)
>else if...
>else if...
>else if...
>.....
>else
>    flag = 1;
>
>if(flag == 1){ }

delete this line:   if (....)
>else if...
>....
>else
>    flag = 2;
>
>if(flag ==2){ }
>... same process repeats
>
> it means that firstly set the value of 'flag' as 0 and 'else if' treatment repeats at constant times (for instance, 100 times) ,and at the last , 'flag' is set to be 1. Next, the value of 'flag' is checked and if it is 1, nothing happens and nesting level finishes and restarts as 'if' and 'else if' repeated at 100 times, Every time 'else if' reached to 100 times , flag ++ and nesting level finishes.As the result, nesting level never exceed maximum.  

It would probably also be worth investigating whether there are not
better ways of implementing what's done here, e.g. via tables or some
such.

Regards,    Martin.




#-#-#  Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University
#-#-#  http://www.sw.it.aoyama.ac.jp       mailto:[hidden email]