Re: Tools for C/C++
Keith Ray <[email protected]> Wed, 22 Sep 2010 03:47:50 +0200
| Newsgroups | gmane.comp.programming.refactoring |
|---|---|
| Message-ID | <[email protected]> |
It's right there in their website (as well as occurring when I tried it):
http://www.wholetomato.com/products/features/extractMethod.asp
"Use care when including local variable declarations in the selected text to
be extracted. Since the declaration is moved to the extracted method,
referencing the variable in the original code outside the selection will
result in a compile error."
The example code has lines 3-8 selected for extract method and 'nCounter' as
the problematic variable.
[ 1 ] void OriginalMethod()
[ 2 ] {
[ 3 ] int nCounter;
[ 4 ] for (nCounter = 0; nCounter < 5; nCounter++)
[ 5 ] {
[ 6 ] cout << "Iteration " << nCounter << endl;
[ 7 ] if (g_bCancel) break;
[ 8 ] }
[ 9 ] cout << "Execution stopped at iteration << nCounter << endl;
[10 ] }
Eclipse will try to either return nCounter or pass it in/out of the
extracted method by reference or pointer. It might not always get it right,
but it tries... :-)
On Wed, Sep 22, 2010 at 3:27 AM, Richard <[email protected]> wrote:
>
> In article <[email protected]<L14VaqN%[email protected]>
>,
> Keith Ray <[email protected]> writes:
>
>> Visual Assist X does Extract Method faster than Eclipse does, but
sometimes
>> creates code that won't compile. That same code would have been
refactored
>> correctly by Eclipse.
>
> I'm not doubting you, but I'd like to see examples of where VAX
> generates code that fails to compile. Whole Tomato has been good
> about fixing such issues promptly when I've reported bugs on them.
> --
> "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
> <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>
>
> Legalize Adulthood! <http://legalizeadulthood.wordpress.com>
>
--
--
C. Keith Ray
Web: http://industriallogic.com
Twitter: @CKeithRay, @IndustrialLogic
Amplify Your Agility
Coaching | Training | Assessment | eLearning
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/refactoring/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/refactoring/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/