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
 Definition bar for do/while loops
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Jan 26 2004 :  6:54:01 PM  Show Profile
When you are inside a do/while loop, the definition bar just says "do". It would be more helpful if it said something like "do {...} while (i >= 10)"

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004

PatLuja
Tomato Guru

Belgium
416 Posts

Posted - Jan 27 2004 :  02:52:22 AM  Show Profile
Hello Stephan (and all others),

I feel your totally right.

Another example of this is the else of an if-statment.
Bringing ones cursor right before a closing brace of the if-statement, presents the if-statement: "if (boolean) {".
Bringing ones cursor right before a closing brace of the else-statement, presents "else {"
Maybe it could present something like "if (boolean) {...} else {". This would be more informative.

Thank you.

With kind regards,
Patrick Luja.
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Jan 27 2004 :  03:06:02 AM  Show Profile
To get into it any deeper:
I'd like to see in which case I am (in a switch() case:).

For example, if I'm in the WM_CLOSE case of my WndProc, I'd like to see "case WM_CLOSE:" in the Definition-Field...

Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Jan 27 2004 :  6:44:03 PM  Show Profile
Patrick: I half-agree, but what if there were a whole list of if-else clauses? What would you display then?

Wannabee: I agree. I notice that if the code for the case has braces round it -- for example if it has local variables within it -- then the definition bar shows the case statement, not the switch statement. But if there are no braces, it shows the switch not the case. I would like to see both the switch and the case every time: something like "switch (nArg) { case (ARG_BLAH):".

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Jan 27 2004 :  8:43:27 PM  Show Profile
The else clause only ever applies to one if, so I would want the correct one displayed. The if of an else if essentially closes the first else clause, so that if is the only one active.

Hmmm. But, what if you had nested ifs? Would you want all of them displayed? I can picture the context text getting VERY long. I guess that would be added incentive to restructure your code....

Joe Pizzi
Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Jan 27 2004 :  8:52:07 PM  Show Profile
If blocks are nested, you certainly only get the inner one. That's already true.

My point is that if you have code like

if (i == 1) {
  DoStuff();
}
else if (i == 2) {
  DoOtherStuff();
}
else {
  DoThirdStuff();
}

and you're inside the final else clause, you don't really want the definition bar to say
if (i == 2) {...} else {

because that would be misleading -- it implies that the else covers all cases where (i != 2).

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

PatLuja
Tomato Guru

Belgium
416 Posts

Posted - Jan 30 2004 :  03:01:35 AM  Show Profile
Hello Stephen,

I must say you have a point there.

Maybe the following should be displayed:
... else if (i == 2) {...} else {
Displaying the whole list could be too long indeed.
The main point here is that displaying something like I suggested above is much better as only displaying:
else {
which leaves you clueless where you exactly are.

I hope they can really do something like this. When someone comes up with a better suggestion I'm eager to hear them. Thanks.

Stephen and jpizzi, thanks for your input.

With kind regards,
Patrick Luja
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000