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
 Technical Support
 Coloring problem with variables named "data"
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

dodudo7
Ketchup Master

Israel
55 Posts

Posted - Nov 10 2004 :  07:45:01 AM  Show Profile
I think that this problem is very old.
In some projects (sometimes even very small ones), a variable
or a method argument named "data" will be colored as class, struct or typedef.
It is also bold if it is a local symbol (which is 100% OK).

I am using VC++ 6 on win2k sp4, VaX 1283

Edited by - dodudo7 on Nov 10 2004 10:00:55 AM

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Nov 10 2004 :  08:42:04 AM  Show Profile
Surprisingly enough, we can't see the images on your local drive.

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

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Nov 10 2004 :  08:46:49 AM  Show Profile
I think the story is that if there are two symbols of the same name, the colouring algorithm can't tell them apart, and that this is so that it can be fast enough to repaint while you're scrolling.

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

dodudo7
Ketchup Master

Israel
55 Posts

Posted - Nov 10 2004 :  09:00:19 AM  Show Profile
Stephen,

1) There is only one symbol with this name - "data"
2) This bug has nothing to do with scrolling.
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Nov 10 2004 :  10:44:48 AM  Show Profile
My thoughts are that "data" is defined somewhere (so there are now two of them), and the result is what Stephen described.

"Data" is one of those terms that is so ubiquitous that I try to never use it as an identifier. Not only is it not very descriptive, there is too much danger of it being #defined somewhere, or at the very least, used in too global of a namespace.

Joe Pizzi
Go to Top of Page

LarryLeonard
Tomato Guru

USA
1041 Posts

Posted - Nov 10 2004 :  10:52:00 AM  Show Profile
I thought we had all agreed to name our variables "A1" through "Z9"?

Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Nov 10 2004 :  11:11:48 AM  Show Profile
Stephen is correct. Our coloring algorithm is built for speed -- ridiculously high speed since it needs to run as you scroll, among less intensive tasks like arrowing or using PageUp to scroll.

Our coloring algorithm makes a fair number of guesses. It's usually correct, but it's reasonable to imagine it thinking a symbol named "data" is a #define or a class.

The algorithm that applies bold is much smarter.
Go to Top of Page

PatLuja
Tomato Guru

Belgium
416 Posts

Posted - Nov 11 2004 :  02:56:55 AM  Show Profile
Hello all,

This topic is also discussed in a topic from eight months ago: Wrongly coloured code.

Isn't it an idea, to run two colouring threads, one that does it really fast, and one that kicks in when there is no change for one second, but gives even better results? (I must admit, I looks like a lot of work and a source for many bugs...)

I hope it gets resolved somehow...once...

With kind regards,
Patrick Luja
Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Nov 11 2004 :  05:19:42 AM  Show Profile
1099 is another reference. Support pointed out in that thread another problem with having two colouring threads. Not only do you have the practical problem of keeping twice as much code free of bugs, but also symbols would change colour when there was a pause in scrolling/typing. This could be very distracting.

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

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Nov 11 2004 :  08:10:54 AM  Show Profile
Just wondering why cant VAX keep a coloring table in memory for the whole actual file? While you scroll the code wont change. And this coloring table can be built while loading the file, and updated while editing. I would gladly waste a few Kb more to have correct coloring always.
During painting VAX would just need to lookup the current position and fetch the coloring information from that table. Sounds not too hard to implement. In fact, much easier than doing it on the fly.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Nov 12 2004 :  12:18:13 PM  Show Profile
Interesting idea.

Unfortunately, we are a bit tied by how the IDE paints text. We intercept what it does, and color just before the text hits the display. ... and the IDE does not paint in any normal pattern. Far from it. A few character here, some down there, a bit more over there, etc. .. And the IDE doesn't exactly tell us what character on the display matches what character in the file.

All said, we will seek inspiration from your suggestion.

Edited by - support on Nov 12 2004 12:20:04 PM
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Nov 12 2004 :  3:48:10 PM  Show Profile
If you have enough information to make an (un-)educated guess at a symbol, you should have enough information to look it up in the coloring table. I think... I hope...

Even then, there should be a pattern (maybe various patterns) in how screen contents is painted. This might lead to an even better estimate what part of the file/screen is being painted now, depending on what was painted before. Uh? Yes? Maybe? I know, IDE sucks. Just making some wild guesses.
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