Updating deprecate commands

SaveLoadGame.loadUnits, line 24
RemoveAllRows is deprecated. You should use RemoveAll instead
u.CommandCapacity.RemoveAllRows

Is there a shortcut o a way to replace the deprecated command for the suggested command?
Now for each deprecated item, for example, RemoveAllRows I must write RemoveAll.

The find and replace is a dangerous item because, for example, “.value” should be replaced for “.text” but not always. So a replace all “.value” could be a disaster. The same with rows, as listboxes still use AddRow, etc.

Short answer: nope :-(.

More optimistic approach: you don’t need to make the switch immediately, but then you will keep catching the warnings. You can try playing around with RegExes in Find & Replace and add some logic, but even that will most likely not work “automatically” for everything.

Screenshot 2020-12-03 at 11.18.03

Another approach is to replace all by control and property. E.g. you start with a given listbox and replace all occurrences of ThisListbox.AddRow, then you move on to the next property; when having done all properties, move to the other objects (use the warnings result to try only the relevant properties and objects).
In the end, it remains the “self.something” and “me.something” whose the context obviously prevent using this method. Replace them manually.

Not perfect, but better than replacing each warning.

1 Like