Author Topic: Macro continues even if string not found v17  (Read 140 times)

JimmieC

  • Senior Community Member
  • Posts: 475
  • Hero Points: 16
Macro continues even if string not found v17
« on: May 17, 2022, 10:21:44 pm »
I posted this back in 2015. Based on this feedback, the SE team change the default behavior.
https://community.slickedit.com/index.php/topic,11357.msg47929.html#msg47929

It seems that v17 has gone back to the previous behavior where the macro continues even if the string is not found. I have attached 3 files here to reproduce. Actually, you only need to use the SE search results.txt file.

To reproduce:
Open SE search results.txt
Ctrl Home - top of file
Ctrl-F "File", Enter, I should go to the first occurrence of the word File
Ctrl Home - top of file
Ctrl-F11 Record macro START
Ctrl-G go to first occurence of File
Home move cursor to beginning of line and deselect
Enter Put a blank space above the line where File was found
Down arrow Get under the line where File was found
Ctrl-F11 Record macro END
Esc Do not save macro
Ctrl-F12 Goes to second File line and inserts a blank line
Ctrl-F12 Inserts a blank line even though the word File is not found
Ctrl-F12 Inserts a blank line even though the word File is not found
Ctrl-F12 Inserts a blank line even though the word File is not found
...

JimmieC

  • Senior Community Member
  • Posts: 475
  • Hero Points: 16
Re: Macro continues even if string not found v17
« Reply #1 on: May 17, 2022, 10:28:30 pm »
I figured out what is happening. Maybe this is OK?

The issue is that the file does not end in a blank line so "DOWN" will fail. Therfore, it stays on the last line which has the word "file" in it. It is stuck on the last line because it cannot go DOWN.

I use these quick, recorded, macros a lot to make various log files, grep files, etc readable. Now I know that I just need to insert a blank line at the end or modify the way I create my macro.

Anyway, apologies, I don't think this is an issue after all.