DialogAddText(100;1001;10;10;200;60;1;"WordPerfect Windows, 5.1/5.2, macro to convert Epson-type attribute/print codes to WP attributes. These are the codes that when brought into WPW appear as {ESC}G, {ESC}-1, {ESC}4, etc. ({ESC} may be represented by an arrow.)")
DialogAddText(100;1002;10;45;200;30;1;"The process will make three loops through the file, one each for bold, underline, and italic. The screen will not display the results until the process is complete.")
DialogDisplay(100;1)
MDR:=MacroDialogResult
DialogDestroy(100)
If(MDR = 2) //If user canceled dialog
Go(End2@)
EndIf
ONCANCEL(end2@)
Display(State:Off!)
PosDocTop()
ONNOTFOUND (fixbold@)
LABEL(loop1@)
SearchText
(
SearchString:"G";
SearchDirection:Forward!;
SearchScope:Extended!
)
DeleteCharPrevious()
DeleteCharPrevious()
SelectMode
(
State:On!
)
SearchText
(
SearchString:"H";
SearchDirection:Forward!;
SearchScope:Extended!
)
FontBold
(
State:On!
)
SelectMode
(
State:Off!
)
DeleteCharPrevious()
DeleteCharPrevious()
GO (loop1@)
LABEL(fixbold@)
PosDocTop()
ONNOTFOUND (fixund@)
LABEL(loop2@)
SearchText
(
SearchString:"-1";
SearchDirection:Forward!;
SearchScope:Extended!
)
DeleteCharPrevious()
DeleteCharPrevious()
DeleteCharPrevious()
SelectMode
(
State:On!
)
SearchText
(
SearchString:"-0";
SearchDirection:Forward!;
SearchScope:Extended!
)
FontUnderline
(
State:On!
)
SelectMode
(
State:Off!
)
DeleteCharPrevious()
DeleteCharPrevious()
DeleteCharPrevious()
GO (loop2@)
LABEL(fixund@)
PosDocTop()
ONNOTFOUND (fixitalic@)
LABEL(loop3@)
SearchText
(
SearchString:"";
SearchDirection:Forward!;
SearchScope:Extended!
)
DeleteCharPrevious()
DeleteCharPrevious()
SelectMode
(
State:On!
)
SearchText
(
SearchString:"";
SearchDirection:Forward!;
SearchScope:Extended!
)
FontItalic
(
State:On!
)
SelectMode
(
State:Off!
)
DeleteCharPrevious()
DeleteCharPrevious()
GO (loop3@)
LABEL(fixitalic@)
PosDocTop()
Display(State:On!)
DialogDefine(200;50;50;100;70;1+16;"")
DialogAddText(200;1002;5;5;80;30;1;"Conversion complete; return to document.")