Problem with MatchBrace

Help with writing and playing macros

Problem with MatchBrace

Postby rdsidan » Mon Nov 29, 2004 11:51 am

I've got the following in my script to delete several sections of a text file that are braced:

Top
Loop
MatchBrace
Key DEL
IfEof
ExitLoop
EndIf
EndLoop

My problem is that after is successfully deletes the first brace section, it doesn't go to the next section...it just starts 'slowly' deleting text one character at a time.

If I try to manually do a Brace command (using CTRL+B) is doesn't always work unless I page down a few screens and the brace section is visually displayed on the screen (of course this doesn't help the macro problem)

Any ideas?
Dan
User avatar
rdsidan
Newbie
 
Posts: 1
Joined: Mon Nov 29, 2004 12:00 am

Re: Problem with MatchBrace

Postby Mofi » Tue Nov 30, 2004 3:22 am

The problem is, that matching brace will not work as excepted, when a closing brace is found without an opening brace. For example a command like // 1.) will stop matching brace at ).
Also your macro is not working correct, if after deleting the last matching brace selection the end of file is not reached (for example comment at end of file). This modified macro will do the job maybe better.

Top
Loop
MatchBrace
IfSel
Delete
Else
Key RIGHT ARROW
EndIf
IfEof
ExitLoop
EndIf
EndLoop
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4039
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Macros