Clever Code Assistants

For anyone that’s interested in using code assistants in the Xojo code editor, I’ve got a few here that might be interesting to you. You can put these in User Home > Documents > Xojo > IDE > Scripts

Flip Assignment
Converts a = b to b = a

Split Declaration
Given a declaration like this:
Dim data as String = tis.ReadAll

The line will be converted to:
data = tis.ReadAll

and the declaration portion ( Dim data as string ) will be copied to the clipboard. Handy if you need to move the declaration out of the current scope.

Swap Handlers
If you use Add/RemoveHandler a lot, you’ll love this one. Given:

AddHandler control.event, addressOf myEventHandler

will swap AddHandler with RemoveHandler (and vice versa):

RemoveHandler control.event, addressOf myEventHandler

works on one or more lines

Remember: You can reload code assistants without relaunching the IDE by holding down the menu modifier key (Command or Control) when right-clicking in the code editor.

12 Likes

Thanks for sharing these @Greg_O