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
 1531: Rename Reference
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

khb
Tomato Guru

Germany
337 Posts

Posted - Aug 11 2006 :  07:06:25 AM  Show Profile  Reply with Quote
I needed to duplicate some code an tried to rename the variables in the copy. After duplicating the code I had something like:
int aaa;
aaa = 0;

int aaa;
aaa = 0;
Then I modified the third line to:
int aaab;
Next I chose "Rename Reference from aaa to aaab" from the refactoring menu. As result I got:
int aaab;
aaab = 0;

int aaab;
aaab = 0;
Instead, I somehow expected to get:
int aaa;
aaa = 0;

int aaab;
aaab = 0;
I know that I'm really doing something unusual here and that this may be impossible to fix. However, I just wanted to present this anyway, because I think that most users would expect the same result as I did.

Regards,
Marcus.

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Aug 13 2006 :  3:56:54 PM  Show Profile  Reply with Quote
i have run into the same effect myself now and then. the recormended solution is to select the new code and use find and replace within this selection. alternatively you could use rename, but untick the references you do not want changed in the list of references you are given.

VA has no way of knowing that you only want to run a rename on a limited scope, and most of the time if it limited the scope of rename it would break your code.

the feature you encountered is there for when you change the name of a variable, and then decide you want to apply this renaming to all occurrences of the variable.

zen is the art of being at one with the two'ness
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Aug 14 2006 :  02:11:51 AM  Show Profile  Reply with Quote
Find and replace within selection sounds good. Thank you, feline!

Regards,
Marcus.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Aug 14 2006 :  6:25:23 PM  Show Profile  Reply with Quote
select the code, then CTRL-H if you prefer using the keyboard

zen is the art of being at one with the two'ness
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Aug 15 2006 :  02:16:16 AM  Show Profile  Reply with Quote
Yeah, I'm using CTRL-H most of the time for getting the replace dialog. But I always ignored the option "Replace in Selection"

Regards,
Marcus.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Aug 15 2006 :  7:13:29 PM  Show Profile  Reply with Quote
for what it is worth i have been doing this for quite a while now, and i am still learning new things about both VA and the IDE's. there are a LOT of options and buttons to explore, so missing things is very easy

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000