Edwin Teisman
Member²
I have become used to using the macro feature a lot.
One of the things which makes recording macros difficult is that lines may have trailing spaces.
Pressing the END button will put the cursor after these spaces, not afte the last word.
For example, suppose I have a number of lines with field names, and I wish to convert these into variables.
I would do this by recording a macro:
I would press END to put the cursor at the end of the line, thenpress SHIFS+LEFT to select the fieldname and press CRTL-C to copy it.
Move the cursor to the beginning of the field name, and prefix it with e.g. "v_".
Then move to the beginning of the line, and move to e.g colomn 30 by presisng RIGTH 30 times.
Then type the tablename + ".", then press CTRL-V to insert the fieldname and finally type "%type".
I can then repeat this macro as many time as I want to declare multiple variables.
I could declare variables for all fieldnames in a table, very quickly.
All of this is very handy.
But is the line have spaces at the end, then the first step pressing END + SHIFT-LEF will select the last word + trailing spaces. That wont do.
So in these cases I use another tool to prepare the file by removing all trailing spaces in the file, then reload the file.
After that my macro mechanism works fine.
Similarly if I press SHIFT-RIGHT the next word will be selected, including trailing spaces.
This is why I am required to work from the end of the line, and not begin from the start of a line.
To sum it up: fantastic to have a macro recording tool. Unfortunately the way the editor handles spaces makes recording a macro difficult.
Possible solution: could the editor be capable of automatically removing traling spaces on a line, such as e.g. the Delphi editor does?
(Note; I sometimes copy text from another editor into PLSQL developer, just so I can use the macro mechanism. Great tool! )
One of the things which makes recording macros difficult is that lines may have trailing spaces.
Pressing the END button will put the cursor after these spaces, not afte the last word.
For example, suppose I have a number of lines with field names, and I wish to convert these into variables.
I would do this by recording a macro:
I would press END to put the cursor at the end of the line, thenpress SHIFS+LEFT to select the fieldname and press CRTL-C to copy it.
Move the cursor to the beginning of the field name, and prefix it with e.g. "v_".
Then move to the beginning of the line, and move to e.g colomn 30 by presisng RIGTH 30 times.
Then type the tablename + ".", then press CTRL-V to insert the fieldname and finally type "%type".
I can then repeat this macro as many time as I want to declare multiple variables.
I could declare variables for all fieldnames in a table, very quickly.
All of this is very handy.
But is the line have spaces at the end, then the first step pressing END + SHIFT-LEF will select the last word + trailing spaces. That wont do.
So in these cases I use another tool to prepare the file by removing all trailing spaces in the file, then reload the file.
After that my macro mechanism works fine.
Similarly if I press SHIFT-RIGHT the next word will be selected, including trailing spaces.
This is why I am required to work from the end of the line, and not begin from the start of a line.
To sum it up: fantastic to have a macro recording tool. Unfortunately the way the editor handles spaces makes recording a macro difficult.
Possible solution: could the editor be capable of automatically removing traling spaces on a line, such as e.g. the Delphi editor does?
(Note; I sometimes copy text from another editor into PLSQL developer, just so I can use the macro mechanism. Great tool! )