Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Make switch from Enum

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Greg Posted - Aug 04 2008 : 8:31:54 PM
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*
4   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Aug 21 2015 : 12:26:39 AM
case=19137 is implemented in build 2073 as the command "Add Missing Case Statements"
feline Posted - Aug 15 2008 : 2:14:58 PM
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
Greg Posted - Aug 15 2008 : 04:27:51 AM
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.
feline Posted - Aug 05 2008 : 2:38:28 PM
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

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000