Goto column 97 in a macro, how?

Help with writing and playing macros

Goto column 97 in a macro, how?

Postby Lars_Sandberg » Wed Jan 03, 2007 3:10 pm

Hi, im using UE 12.20b. I need to create a macro that goto column 97 on the line, where the cursor are.
In the standard UI, I can just type CRTL-G and the "/97", but when this is recorded into a macro, it defaults to "1/97" which means line 1 and column 97. When I edit the macro-code back to "/97", UE returns "invalid code".
How do i make UE to goto column 97?

regards Lars
User avatar
Lars_Sandberg
Newbie
 
Posts: 7
Joined: Sat Nov 25, 2006 12:00 am

Re: Goto column 97 in a macro, how?

Postby Mofi » Wed Jan 03, 2007 5:17 pm

As already explained in my last post at UE 12.20: Error in macro on UE-startup the GotoLine and GotoLineSelect commands can be used since UE v12.20a+2 and UES v6.10a+2 with line number 0. 0 means in current line. So

GotoLine 0 200

sets the cursor in current line to column 200. And

GotoLineSelect 0 150

sets the cursor in current line to column 150 with selecting everything from current cursor position till column 150.

In previous versions a "GotoColumn" to column 200 was possible only with

Key HOME
IfColNumGt 1
Key HOME
EndIf
Loop 200
Key RIGHT ARROW
IfColNumGt 200
ExitLoop
EndIf
EndLoop

Tabs are a problem with this workaround. That's the reason for IfColNumGt.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4061
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Goto column 97 in a macro, how?

Postby Lars_Sandberg » Sat Jan 13, 2007 12:54 am

Hi Mofi, thanks that helped :-)
User avatar
Lars_Sandberg
Newbie
 
Posts: 7
Joined: Sat Nov 25, 2006 12:00 am

Re: Goto column 97 in a macro, how?

Postby Mofi » Sat Jan 13, 2007 1:49 pm

Please note: From UE v12.20 to version 13.00+1 (= UES v6.10 to v6.20+1) all versions of UE/UES are setting the cursor wrong in the first line of an ASCII file by 1 column. For example the command

GotoLine 1 1

sets the cursor after first character in line 1 if the file is an ASCII file instead of before. The problem does not exist on Unicode files. I think, internally UE/UES always adds +1 to the column number if the current line is line 1 of the file because of the BOM of Unicode files. But an ASCII file does not have a BOM and so the cursor placement is then wrong by 1. I have already reported this to IDM support and the bug was confirmed.

This bug was fixed with UE v13.00+2 and UES v6.20+2.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4061
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Macros