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
 Feature Requests
 Invert Assignment / Comparism
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
1778 Posts

Posted - Mar 18 2020 :  09:50:42 AM  Show Profile  Reply with Quote
Something really simple that I need often: invert assignments.
I often have code like this in a initializer somewhere (dialogs most often):


  txtField1.Text = _member1.field1;
  txtField2.Text = _member1.field2;
  txtField3.Text = _member1.field3;
  txtField4.Text = _member1.field4;
  txtField5.Text = _member1.field5;
  txtField6.Text = _member1.field6;

Now I have to write code to do exactly the opposite: assign the .Text contents to the members.

  _member1.field1 = txtField1.Text;
  _member1.field2 = txtField2.Text;
  ...

Would be so fantastic if it was possible to select the code and simply do a "invert assignments".

Could also extend this to comparisms like in
if(_member1.field.Items.Count == _othermember.contents.total.MaxItems)

feline
Whole Tomato Software

United Kingdom
16408 Posts

Posted - Mar 18 2020 :  1:26:41 PM  Show Profile  Reply with Quote
We are considering the idea of inverting if and other types of statements:

case=27848

which would cover this, but also more complex statements.

Have you considered a regex find and replace for these string assignments? It is the sort of thing that regex is good at, and if you have a block, probably worth a try.

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:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000