Switch Assignment

Top  Previous  Next

The Switch Assignment feature allows you to swap the left and right sides of an assignment statement of one or more selected lines in a source code file. This is useful, for example, when you have to assign the values to a set of controls:

 

TextBoxFirstName.Text = sFirstName

TextBoxLastName.Text = sLastName

TextBoxEMail.Text = sEMail

and in another part of your code you have to do the opposite assignment:

 

sFirstName = TextBoxFirstName.Text

sLastName = TextBoxLastName.Text

sEMail = TextBoxEMail.Text

In this case the second block of code could be generated copying and pasting the first block, selecting the pasted block and applying this feature.

MZ-Tools offers the following ways to switch the terms of an assignment:

  • The MZ-Tools | Other Utilities | Switch Assignment menu.
  • The MZ-Tools | Switch Assignment context menu of a code window.
  • The Other Utilities | Switch Assignment button on the MZ-Tools toolbar.
  • The keyboard shortcut associated with the MZTools6_VSXXXX.SwitchAssignment command.

See Also:

Keyboard Shortcuts Options