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
 Feature Requests
 Auto Features
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Wrongway
Tomato Guru

USA
129 Posts

Posted - Sep 13 2005 :  10:56:09 AM  Show Profile
Currently I am working in Java using NetBeans Beta 5.0 and I have used Eclipse 3.2. Each of these IDE's have a way of selecting a method of an object and having the try/catch with the exception placed within the catch( xxx ) populated. Another thing that is nice, is when you implement an interface it asks if you wish to implement all the interfaces. If you say "Yes", then it palces all the skeleton code for each method in.

I was wondering... how much of a pain in the 6 would it be for VA to implement something like this?


Wrongway

feline
Whole Tomato Software

United Kingdom
17975 Posts

Posted - Sep 13 2005 :  2:42:05 PM  Show Profile
i cannot visualise from the description what is happening with the try/catch insert. if you could post a small "before and after" example it would help. you may well be able to do this with the new autotext features in VA 1422 using the $selected$ token.

when you say skeleton code for interfaces what do you mean, and in which language? i am aware of the short hand getter / setter methods (who's name temporarily escapes me) in C#, but no obviously analogous feature in C++.

various of my classes in C++ have getter / setter functions for some or even all of the member variables (database wrapper classes are a good example) but then you run into the fact that different people have different conventions for naming these functions, plus for wrapping parameters and return types in "const" and "&" (reference).

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

Wrongway
Tomato Guru

USA
129 Posts

Posted - Sep 13 2005 :  4:58:54 PM  Show Profile
Example:

Before:

File.Delete( <filename> );

After (putting cursor or selecting line and selecting surrond try/catch

try {
File.Delete( <fielname > );
}
catch( UnauthorizedAccessException e ) {
}
catch( ArgumentException e ) {
}
catch( ....

This may or maynot be possible (or a really pain in the butt) to do. But it would be nice. The good idea fairy!

Wrongway
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17975 Posts

Posted - Sep 14 2005 :  2:12:50 PM  Show Profile
where does the list of exception types come from? if it is hard coded, or there are only a small set of them then if you want to try the VA beta 1422 then you can do this with autotext.

creating a C++ autotext rule with the following settings:
title = try / catch
leave shortcut blank
leave description blank
for the code enter:


try {
    $selected$
}
catch( UnauthorizedAccessException e ) {
}
catch( ArgumentException e ) {
}
catch( ... ) {
}


then simply highlight the line / function and use the insert autotext toolbar, then select the item called "try / catch". so long as the lists of exceptions are basically fixed you can create as many of these rules as you want, just give them helpful names or you will loose track of what you are doing.

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

feline
Whole Tomato Software

United Kingdom
17975 Posts

Posted - Sep 14 2005 :  2:14:40 PM  Show Profile
actually, if when you install 1422 you allow it to use the default autotext, or you open the file "templates/latest/cpp.tpl" you will find three example try / catch autotext rules already defined.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2021 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000