On 4/27/2004 1:29:35 AM, John H wrote:
>
>Since this is my first macro I'd appreciate any feedback,
>help, suggestions, etc.
John:
Your macro is nice done for your first VEDIT macro!
Since you asked for comments, here we go...
Some comments to your macro (my *personal* opinion and style):
1)
Search("(!--MOD@DATE-->",ERRBREAK)
Char(15)
can be done in one command:
Search("(!--MOD@DATE-->",ERRBREAK+ADVANCE)
2)
if(Match("|D|D|D|D|045|D|D|045|D|D")==0)
can be written as
if(Match("|D|D|D|D-|D|D-|D|D")==0)
to be better readable.
3)
Goto MODATE
Goto's should be avoided.
They may produce unstructured, hard to maintain macros.
4)
Ins_Newline(1)
Char(-2)
Newlines are not always 2 bytes long. If you are editing
Unix-style text it's only a <LF> for example.
There is a variable to help here:
Newline_Chars
Number of chars in "newline" (See "File Types"). "0" in record/binary mode.
I attached another version of your macro to this message: how I would code it (e.g.).
Perhaps you can get some more infos from that.
Christian