The Convert to Free Format is designed to convert entire line(s) of code, not selected characters. If the last line is only partially selected, the remaining text on that line will be appended to the converted source. This is likely not desirable and will cause the last line of the converted source to be malformed.
So, if conversion is requested with some text being selected, the selection should adjust the selection range to start at the beginning of the first selected line and extend to the end of the last selected line.
Fixed format RPG:
* Select from start to end of subfield, `myfld`, then convert
d myDs ds qualified
d myfld 3a
Wrong output:
// Select from start to end of subfield, `myfld`, then convert
Dcl-DS myDs qualified;
myfld; 3a
Expected output:
// Select from start to end of subfield, `myfld`, then convert
Dcl-DS myDs qualified;
myfld Char(3);
End-DS;
Note: In the examples above the **FREE was not added because we made a selection prior to converting the code.
The Convert to Free Format is designed to convert entire line(s) of code, not selected characters. If the last line is only partially selected, the remaining text on that line will be appended to the converted source. This is likely not desirable and will cause the last line of the converted source to be malformed.
So, if conversion is requested with some text being selected, the selection should adjust the selection range to start at the beginning of the first selected line and extend to the end of the last selected line.
Fixed format RPG:
Wrong output:
Expected output:
Note: In the examples above the **FREE was not added because we made a selection prior to converting the code.