You are here: AxTools > CodeSMART 2009 for VS.NET > Documentation > User's Guide > Simple Code Builders > Switch Assignment Values
While browsing this page, why not start downloading the evaluation setup kit (direct download, no questions asked).

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:

  1. 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.
  2. Place the cursor on the desired code line or select multiple lines if you want to modify more than a line.
  3. 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
Simple Code Builders Overview
The Class Builder
The Property Builder
The Method Builder

Back To Top