Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1530: Variable Scope Bug

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
gmx Posted - Jul 10 2006 : 04:28:01 AM
For example:

typedef struct tagTestStruct1
{
	int data1;
	int data2;
} TestStruct1;

typedef struct tagTestStruct2
{
	int data3;
	int data4;
} TestStruct2;

void test(void)
{
	int data;
	list<TestStruct1> test1;
	list<TestStruct2> test2;

	for(list<TestStruct1>::iterator it=test1.begin();it!=test1.end();it++)
	{
		data=it->data1;
	}

	for(list<TestStruct2>::iterator it=test2.begin();it!=test2.end();it++)
	{
		data=it->data3;//Wrong member hint and can't identify "data3" declaration
	}
}


The second "it" is identified with the first one.
1   L A T E S T    R E P L I E S    (Newest First)
support Posted - Jul 10 2006 : 11:48:12 AM
Unfortunately, the behavior is by design. See the caveat in the paragraph about Duplicate Context at:

http://www.wholetomato.com/products/features/context.html?more=yes

VA X can't use the typical scheme of distinguising symbols, i.e. file offsets, employed by parsers of static code. VA X is forced to use a scheme that allows definitions to move while you edit. You just bumped into the downside.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000