Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 problems with Function Try Blocks
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Babak
Junior Member

Germany
10 Posts

Posted - Nov 10 2006 :  07:53:31 AM  Show Profile  Reply with Quote
Hallo,

VA_X.dll file version 10.3.1540.0 built 2006.10.27
VAOpsWin.dll version 1.3.3.7
VATE.dll version 1.0.5.9
DevEnv.exe version 7.10.6030.0
msenv.dll version 7.10.6030.0
Font: Courier New 11(Pixels)
Comctl32.dll version 5.82.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
2 processors

With this code

void tst()
try{
}catch(...){
}

I see in the "List Methods in File" (Alt+M) two methods:
catch(..)
tst()

Babak

feline
Whole Tomato Software

United Kingdom
19025 Posts

Posted - Nov 10 2006 :  10:54:56 AM  Show Profile  Reply with Quote
If this code is not inside a function then I see the same thing. Change the code to:

void tst()
{
    try{
    }catch(...){
    }
}

and the problem goes away.

A try / catch block outside of a function does not compile, which helps explain why VA does not understand this.

zen is the art of being at one with the two'ness
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Nov 11 2006 :  12:47:20 AM  Show Profile  Reply with Quote
Sorry, feline. The code that Babak posted is valid C++. Try this:

void myFunc( int z )
try { int x = 1; }
catch (...)
{
// body of function
}

I remember there being a bug already reported on this. I no longer have access to the bug database, so I can't look for it.

Joe Pizzi

Edited by - jpizzi on Nov 11 2006 12:53:06 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19025 Posts

Posted - Nov 11 2006 :  10:08:40 AM  Show Profile  Reply with Quote
I did not know you could do that. It seems I learn something new about C++ every week

I did try and compile the original code, just to make sure, but that does not compile. Your version does compile quite happily.

case=1867

zen is the art of being at one with the two'ness
Go to Top of Page

jorgito11
Senior Member

USA
29 Posts

Posted - Nov 11 2006 :  12:34:07 PM  Show Profile  Reply with Quote
In your defense, feline, function try blocks aren't used very much. It is mostly used with constructors.
Go to Top of Page

Babak
Junior Member

Germany
10 Posts

Posted - Nov 13 2006 :  11:15:02 AM  Show Profile  Reply with Quote
quote:
Originally posted by feline

I did try and compile the original code, just to make sure, but that does not compile.




sorry about my untested simplification.

Babak
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000