by Mofi » Thu Apr 05, 2007 8:58 am
Okay, I found the horrible bug of the edit macro dialog of UE v13.00+? and UES v6.20+? which is causing all the problems you see. A string with an odd number of double quotes inside is not compiled anymore correct when closing the macro in the edit macro dialog.
The code part
Find """
Replace All ""
is correct recorded with the macro recorder. But if a user modifies the macro later in the editor, the compiler will interprete this as follows for your macro:
Find """
Replace All ""
...
...
GotoLine 1 38
ColumnInsert "USD,"
Top
"
And the rest of the code of your macro is interpreted as simple text. If you look on the re-opened macro after editing you will find an additional double quote at end of the macro indicating that the macro code is interpreted as text.
That is really a horrible bug. I run several tests and I have seen that this bug also exists with UE v13.00+5, UE v13.00+2 (I don't have anymore v13.00+1 and v13.00), but not with UE v12.20b+1 or any other v12.20.
I will report this horrible bug also to IDM.
And I will report also that GotoLineSelect with column number does not select the correct range from current cursor position to the specified line/column in column mode when selecting in reverse direction. I have seen that as I looked on your code:
GotoLine 0 22
GotoLineSelect 2 25
Key SHIFT
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
A selection with GotoLineSelect from line 2 column 22 to last line column 25 would work, but the line number of the last line is normally not known and so a fixed line number cannot be used.
As I workaround for all the problems I have modified the macro now to this one which hopefully does the same as your one. The red highlighted part is the workaround for the double quote character problem inside a string. As you can see I insert at top of the file 2 double quote characters (only 1 is not possible because of the bug), delete the second one directly, select the first one and replace all double quote characters with nothing which deletes also the inserted double quote character.
InsertMode
HexOff
UnixReOn
ColumnModeOff
Top
""""
Key BACKSPACE
StartSelect
Key LEFT ARROW
Find "^s"
Replace All ""
EndSelect
Find ",TJU_Employee_Total,"
Replace All ","
Find ",Final,"
Replace All ","
Find "PROD_NONE"
Replace All " "
Find "PROD_"
Replace All ""
Find "FY07"
Replace All "2007"
Find "Jul"
Replace All "001"
Find "Aug"
Replace All "002"
Find "Sep"
Replace All "003"
Find "Oct"
Replace All "004"
Find "Nov"
Replace All "005"
Find "Dec"
Replace All "006"
Find "Jan"
Replace All "007"
Find "Feb"
Replace All "008"
Find "Mar"
Replace All "009"
Find "Apr"
Replace All "010"
Find "May"
Replace All "011"
Find "Jun"
Replace All "012"
ColumnModeOn
ColumnInsert "B,Budget,"
Top
"
"
GotoLine 2 38
ColumnInsert "USD,"
GotoLine 2 22
ColumnCut 3
GotoLine 2 2
Paste
GotoLine 2 25
ColumnDelete 1
Top
DeleteLine