Hi All

Merry Christmas to all and wishing you all a very happy 2017.

When coding DataFlex do you also want to line up the ' to' in your code. Sometimes you take the time for it, other times you don't. I've developed a macro that lines up the selected code in your editor of choice (Studio, notepad++ etc), copies it, lines up the ' to ' and paste it back.

So e.g.
Code:
tOrderDtl theOrderDtl
Move OrderDtl.Order_Number to theOrderDtl.Order_Number
Move OrderDtl.Detail_Number to theOrderDtl.Detail_Number
Move OrderDtl.Item_ID to theOrderDtl.Item_ID
Move OrderDtl.Qty_Ordered to theOrderDtl.Qty_Ordered
Move OrderDtl.Price to theOrderDtl.Price
Move OrderDtl.Extended_Price to theOrderDtl.Extended_Price
With attached macro, you select the lines, press <Ctrl>+<Zero> and it changes the selected code to
Code:
tOrderDtl theOrderDtl
Move OrderDtl.Order_Number   to theOrderDtl.Order_Number
Move OrderDtl.Detail_Number  to theOrderDtl.Detail_Number
Move OrderDtl.Item_ID        to theOrderDtl.Item_ID
Move OrderDtl.Qty_Ordered    to theOrderDtl.Qty_Ordered
Move OrderDtl.Price          to theOrderDtl.Price
Move OrderDtl.Extended_Price to theOrderDtl.Extended_Price
The Macro:
- Copies the selected text into the clipboard
- for every line with ' to ' it calculates its location, and sets the 'minimal spaces'
- Inserts the spaces where requires, leaves lines without ' to ' as is
- Paste's the code back

It is using the magnificent AutoHotKey keyboard macro program.

To use this, either just run the LineUpCodeOnTo.exe, or its source code LineUpCodeOnTo.ahk and the AutoHotKey program.

When starting the exe, it only shows an icon in the Tray, showing you that the <Ctrl>+<Zero> key is active. If you like add it to your computer startup script, or start on demand.

Hope you enjoy the macro, and happy coding!
LineUpCodeOnTo.zip

Kind regards
Marco