Switch Assignment Values
Applies to: Visual Studio .NET 2002, Visual Studio .NET 2003, Visual Studio 2005, Visual Studio 2008
This code builder tool can be used to quickly swap the left and right sides
of an assignment operation ('left_side = right_side'). This feature is very useful when retrieving and
setting the values for the same variables (e.g. in reading
and writing database fields, reading and writing array
values etc.) when one set of assignments can be easily
generated from the other one.
To switch the left and right sides of an assignment
operation:
-
Open the code module containing the assignment. You will usually have to duplicate the
original assignment block at the place where you will need
the reverse assignment operations to be made.
-
Place the cursor on the desired code line or
select multiple lines if you want to modify
more than a line.
-
Select Switch Assignment Values in the code
window shortcut menu or in the CodeSMART main menu.
Notes
-
The result of the operation is strongly dependent
on the selection you made at step 2. You should avoid
selecting code lines that you do not want to be changed.
-
Code lines that do not include a valid
assignment operator (' = ') will remain unchanged.
See Also
Back To Top
|