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
 Hide code paths
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Jan 20 2020 :  10:54:17 AM  Show Profile  Reply with Quote
Crazy idea came to my mind now, something that might be tremendously useful though: hide code paths for a given set of variables.
WTF? yeah, let me show an example:


if(var1 == 0)
{
}
else
{
}

Now I can set "var1" to a value, like "0" and all code not executed with this value, is faded out, hidden, collapsed, whatever.

Dont tell me that this is a huge effort, I know that. Yet I wish I had that sometimes.

feline
Whole Tomato Software

United Kingdom
16896 Posts

Posted - Jan 21 2020 :  04:53:02 AM  Show Profile  Reply with Quote
Are you aware that the IDE already does something like this, except that it only checks code disabled via the preprocessor, so #if and related blocks. Make sure you have turned On:

IDE tools menu -> Options -> Text Editor -> C/C++ -> View -> Show Inactive Blocks

and try the code:

if(var1 == 0)
{
}
#ifdef INACTIVE_CODE_CURRENTLY
else
{
}
#endif

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

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Jan 21 2020 :  05:28:40 AM  Show Profile  Reply with Quote
no no no, thats not what I am talking about. I dont want do modify the code. I want to assign a value to variables and the IDE evaluates code flow based on those values and fades out code that is not executed.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16896 Posts

Posted - Jan 21 2020 :  11:20:35 AM  Show Profile  Reply with Quote
Um... over what sort of scale? Just one function, the entire solution, or something in between?

Short of actually compiling and executing the code, once the scale gets beyond "tiny" you are likely to get all sorts of edge cases and errors, suggesting that compiling and executing is the best and most reliable solution. This is before we get into the question of how to set the variable value to evaluate...

Interesting, but I am very wary of how wide ranging and complex this could quickly get.

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