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
 Make switch from Enum
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Greg
New Member

Australia
6 Posts

Posted - Aug 04 2008 :  8:31:54 PM  Show Profile  Reply with Quote
Is there, or how would you make a switch statement from an enum?

ie. by right clicking on app or something??
	enum AppType
	{
		Windows,
		Web,
		Java
	};

	DoStuff( AppType app )
	{
		app
	}


Create the following
	DoStuff( AppType app )
	{
		switch( app )
		{
		case Windows:
		case Web:
		case Java:
		default:
		}
	}


break; could be added optionaly to each case.

From that point it is easy enough to remove or re arrange the case statements more precisely.

*moved by feline*

Edited by - feline on Aug 05 2008 2:37:32 PM

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Aug 05 2008 :  2:38:28 PM  Show Profile  Reply with Quote
You might find this interesting. I suspect it is C# specific. You have not said what language you are working with in your code.

http://www.onesoft.dk/?tag=/visual+studio

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

Greg
New Member

Australia
6 Posts

Posted - Aug 15 2008 :  04:27:51 AM  Show Profile  Reply with Quote
Yes, that is exactly what I was after, if it could be done in C++.

Unfortunately the inbuilt snippets manager of Visual studio limits it's language support to Visual Basic/C#/J# and XML.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Aug 15 2008 :  2:14:58 PM  Show Profile  Reply with Quote
It is a tempting idea, and I do see the appeal of having this in C++. I am wondering how best to trigger and control this. You would need to tell VA which enum to operate on. Typing the enum or variable of enum type and triggering the command on it might work well.

I have put in a feature request to see what our developers make of this:

case=19137

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

sean
Whole Tomato Software

USA
2817 Posts

Posted - Aug 21 2015 :  12:26:39 AM  Show Profile  Reply with Quote
case=19137 is implemented in build 2073 as the command "Add Missing Case Statements"
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