Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Invert Assignment / Comparism

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Uniwares Posted - Mar 18 2020 : 09:50:42 AM
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)

1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Mar 18 2020 : 1:26:41 PM
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.

© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000