how do you do a play to end of document

Help with writing and playing macros

how do you do a play to end of document

Postby ralbert » Mon Apr 25, 2005 3:14 pm

trying to create a comman line batch process that will allow me to play several macros, but the macros need to play to the end of the file. the file will neve have the same number of lines in it. So utilizing the number of lines on the command line does not work. You can run a macro to the end of the file in interactive mode, so is there a command to allow it to be done in command line.
User avatar
ralbert
Newbie
 
Posts: 1
Joined: Sun Apr 24, 2005 11:00 pm

Re: how do you do a play to end of document

Postby Mofi » Tue Apr 26, 2005 1:18 am

Loop
:
:
IfEof
ExitLoop
EndIf
EndLoop

OR

Loop
:
:
IfNotFound
ExitLoop
EndIf
EndLoop
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: how do you do a play to end of document

Postby Hownow » Wed Nov 29, 2006 5:15 pm

I have a script that trims the leading spaces in a grouping of text. It works fine until the last line. The Key Down Arrow command doesn't move to a new line and the macro runs continuously within the last line and deletes everything. I can't seem to coordinate the IfEof command to reference the fail of the Key DOWN ARROW to execute at the end of the file. Your thoughts would be appreciated.

Code: Select all
InsertMode
ColumnModeOff
HexOff
UnixReOff
TrimTrailingSpaces
Top
Loop
Find RegExp "[0-9a-zA-Z]"
Key LEFT ARROW
StartSelect
Key HOME
EndSelect
Key DEL
Key DOWN ARROW
IfEof
ExitLoop
EndIf
EndLoop


Thank you
User avatar
Hownow
Newbie
 
Posts: 5
Joined: Thu Apr 20, 2006 11:00 pm

Re: how do you do a play to end of document

Postby Mofi » Thu Nov 30, 2006 8:18 am

Once again the problem with a file which does not really have a last line because the characters at the end of the file are not terminated with a line termination (CR+LF for DOS files). Solution: add line termination at end of the file if not already present. Insert one of the following codes before command Top in your macro:

Bottom
IfColNum 1
Else
"
"
EndIf


or

Bottom
IfColNumGt 1
"
"
EndIf
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Macros