Author |
Topic |
|
LarryLeonard
Tomato Guru
USA
1041 Posts |
Posted - Dec 10 2003 : 09:39:36 AM
|
In the code below:
SEQ distBranchSeq (dsCreditMemo.GetL("dist_seq")); SEQ rebateBatchSeq (dsCreditMemo.GetL("rebate_batch_seq")); CString sCreditMemoNbr(dsCreditMemo.GetS("credit_memo_nbr")); CString sCurrencyType (dsCreditMemo.GetS("currency_type"));
... the four variables defined should all be the same color, naturally. The third variable, 'sCreditMemoNbr', however, has the same color as the 'GetL()' and 'GetS()' methods. I've rescanned the file, and I have it set to always reparse when loading the workspace. |
|
Cezariusz
Tomato Guru
Poland
244 Posts |
Posted - Dec 10 2003 : 10:18:13 AM
|
Just tried and couldn't reproduce. Do you have by chance 'sCreditMemoNbr' defined somewhere else? Although it didn't matter in my test case, why where's no space after 'sCreditMemoNbr' and it's after all other variables?
|
Cezariusz Marek https://midicat.net/ |
|
|
LarryLeonard
Tomato Guru
USA
1041 Posts |
Posted - Dec 10 2003 : 10:33:20 AM
|
Nope, that's the only place in the whole workspace it's defined.
There's no space so that the code is vertically aligned, as all right-thinking programmers do!
SEQ distBranchSeq (dsCreditMemo.GetL("dist_seq"));
SEQ rebateBatchSeq (dsCreditMemo.GetL("rebate_batch_seq"));
CString sCreditMemoNbr(dsCreditMemo.GetS("credit_memo_nbr"));
CString sCurrencyType (dsCreditMemo.GetS("currency_type"));
Hey! If I put a space after 'sCreditMemoNbr', that fixes it:
SEQ distBranchSeq (dsCreditMemo.GetL("dist_seq"));
SEQ rebateBatchSeq (dsCreditMemo.GetL("rebate_batch_seq"));
CString sCreditMemoNbr (dsCreditMemo.GetS("credit_memo_nbr"));
CString sCurrencyType (dsCreditMemo.GetS("currency_type"));
It's still a bug, though. |
|
|
gstelmack
Ketchup Master
USA
76 Posts |
Posted - Dec 10 2003 : 10:44:58 AM
|
Visual Assist has always done this: it checks for member functions by looking for the '('. I agree that it would be much better for it to have more context information and realise that it's a variable. |
-- Greg Stelmack, Red Storm Entertainment |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Dec 10 2003 : 11:39:57 AM
|
Greg is right in that VA has always done this. VA guesses color using algorithms very different from ones used to fill in our Context and Definition fields, underline, correct case, etc.
VS.NET displays new text as you scroll. VA has to intercept the display and insert coloring tweaks. There simply isn't enough time and CPU power for extensive parsing as you scroll. Instead, we fire up some algorithms that use a slew of heuristics to guess color. VA looks at preceding and subsequent characters, eg a (, and makes quick checks in our symbol databases for the existence of like-named #defines and/or symbols in the current file.
Parentheses and #defines are usually behind improper guessing on the part of VA.
We regularly look at snippets of incorrectly colored code to make our heuristics better. We will look at your snippet. You are welcome to play detective, decipher our algorithms and suggest improvements.
FWIW, The limitation is the reason we cannot use color to distinguish static versus global. |
Whole Tomato Software, Inc. |
|
|
|
Topic |
|