Hi,
This is a extract of my macros.vtm file (the match line is much longer in the original).
I use a ; as the trigger character rather then the dot.
Code:
if (Cur_Pos < 3) { Return } //Return if too close to BOF
Char(-3) //Backup to possible ";xx"
if (Cur_Char != ';') { //If not a ";"
Char(3) // Restore position
Return // and return
}
Char(1) //Skip over ";" to match code
Match("|{|D|D,bn,bf,bs,bb,be,bl,bp,fn,st,cc,cl,cm,em,ep}",noerr)
if(return_value==3) {
Char(2) //Restore position
return
}
if(Match_item==1) {
del_char(-1)
ins_text("|@(") // )
char(3)
// (
ins_text(")")
update()
return
}
Reg_Copy_Block(109,CP,CP+2,DELETE)
Del_Char(-1)
Goto |@(109)
You will notice the first entry in the match command is |D|D, and you see the code starting with if(Match_item==1).
Anyways, now I am able to go ;45 and have that changed to |@(45). It works for any 2 digit number.
For t-regs 0-9, just use a leading zero. such as ;08 which gives you |@(08), Vedit ignores the leading zero.
Scott