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
 VAX 1206 on VC6 - variable colored as method
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

LarryLeonard
Tomato Guru

USA
1041 Posts

Posted - Dec 10 2003 :  09:39:36 AM  Show Profile
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  Show Profile
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/
Go to Top of Page

LarryLeonard
Tomato Guru

USA
1041 Posts

Posted - Dec 10 2003 :  10:33:20 AM  Show Profile
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.
Go to Top of Page

gstelmack
Ketchup Master

USA
76 Posts

Posted - Dec 10 2003 :  10:44:58 AM  Show Profile
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
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Dec 10 2003 :  11:39:57 AM  Show Profile
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.
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