'L_C2Tag.mac by Kabuneko 99/01/25
'Replace Upper ASCII characters with HTML tags

proc main
if @hwnd = 0 then exit proc
const chars$ = "[/""&<>\xA0-\xFE]"

@@FindRegExp = -1 'Search with Regular Expression on
@@FindRegExp = -2 'Regular Expression on/off will be restored
@UndoBlock = 1

print "Processing file ..."
@Redraw = 0
@MoveFileTop
do while 1
@FindStringBottom chars$
    if @@SearchFound = 0 then exit do
    ChangeToTag
loop

@MoveFileTop
@InsertF "<HTML><HEAD><META HTTP-EQUIV=""Content-Type"" CONTENT=""text/html; charset=ISO-8859-1""></META></HEAD>\n<BODY>\n"
@ReplaceString2 "\n", "<BR>\n", 1
@MoveFileBottom
@InsertF "\n</BODY>\n</HTML>\n"

@Redraw = 1
@UndoBlock = 0
print ""
call msgbox("Done !!!")
end proc

sub ChangeToTag
    dim char
    char = @Code
    @DeleteChar
    @Insert cformat$("&#%d;",char)
end sub