Hello,
I'm trying to write a macro to change numbers to roman numerals. Ideally to search and find the word "Chapter" and replace the number [1-?] after it with "I, II, III, IV ..." So far this what I have:
Main
RomanNums1
RomanNums2
RomanNums3
RomanNums4
I works, but still adds in some numbers and botches the last chapter. Any help would be greatly appreciated.
Best regards,
PoorPatriot
I'm trying to write a macro to change numbers to roman numerals. Ideally to search and find the word "Chapter" and replace the number [1-?] after it with "I, II, III, IV ..." So far this what I have:
Main
Code: Select all
InsertMode
ColumnModeOff
HexOff
Top
Clipboard 9
ClearClipboard
Clipboard 8
ClearClipboard
Clipboard 7
ClearClipboard
Clipboard 6
ClearClipboard
Loop
Find Select MatchCase "Chapter "
IfSel
EndSelect
Key END
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
IfCharIs "0123456789"
StartSelect
Key RIGHT ARROW
Clipboard 6
Copy
EndSelect
PlayMacro 1 "RomanNums4"
Else
Key RIGHT ARROW
EndIf
IfCharIs "0123456789"
StartSelect
Key RIGHT ARROW
Clipboard 7
Copy
EndSelect
PlayMacro 1 "RomanNums3"
Else
Key RIGHT ARROW
EndIf
IfCharIs "0123456789"
StartSelect
Key RIGHT ARROW
Clipboard 8
Copy
EndSelect
PlayMacro 1 "RomanNums2"
Else
Key RIGHT ARROW
EndIf
IfCharIs "0123456789"
StartSelect
Key RIGHT ARROW
Clipboard 9
Copy
EndSelect
PlayMacro 1 "RomanNums1"
EndIf
EndIf
EndSelect
Key END
DeleteToStartofLine
InsertMode
"Chapter "
Clipboard 6
Paste
ClearClipboard
Clipboard 7
Paste
ClearClipboard
Clipboard 8
Paste
ClearClipboard
Clipboard 9
Paste
ClearClipboard
Key DOWN ARROW
IfEof
ExitLoop
EndIf
EndLoop
Clipboard 9
ClearClipboard
Clipboard 8
ClearClipboard
Clipboard 7
ClearClipboard
Clipboard 6
ClearClipboard
Clipboard 0
Code: Select all
NewFile
Paste
EndSelect
Key END
StartSelect
Key LEFT ARROW
OverStrikeMode
IfCharIs "1"
"I"
EndIf
IfCharIs "2"
"II"
EndIf
IfCharIs "3"
"III"
EndIf
IfCharIs "4"
"IV"
EndIf
IfCharIs "5"
"V"
EndIf
IfCharIs "6"
"VI"
EndIf
IfCharIs "7"
"VII"
EndIf
IfCharIs "8"
"VIII"
EndIf
IfCharIs "9"
"IX"
EndIf
IfCharIs "0"
ClearClipboard
EndIf
Key HOME
StartSelect
Key END
Copy
EndSelect
CloseFile NoSave
Code: Select all
NewFile
Paste
EndSelect
Key END
StartSelect
Key LEFT ARROW
OverStrikeMode
IfCharIs "1"
"X"
EndIf
IfCharIs "2"
"XX"
EndIf
IfCharIs "3"
"XXX"
EndIf
IfCharIs "4"
"XL"
EndIf
IfCharIs "5"
"L"
EndIf
IfCharIs "6"
"LX"
EndIf
IfCharIs "7"
"LXX"
EndIf
IfCharIs "8"
"LXXX"
EndIf
IfCharIs "9"
"XC"
EndIf
IfCharIs "0"
ClearClipboard
EndIf
Key HOME
StartSelect
Key END
Copy
EndSelect
CloseFile NoSave
Code: Select all
NewFile
Paste
EndSelect
Key END
StartSelect
Key LEFT ARROW
OverStrikeMode
IfCharIs "1"
"C"
EndIf
IfCharIs "2"
"CC"
EndIf
IfCharIs "3"
"CCC"
EndIf
IfCharIs "4"
"CD"
EndIf
IfCharIs "5"
"D"
EndIf
IfCharIs "6"
"DC"
EndIf
IfCharIs "7"
"DCC"
EndIf
IfCharIs "8"
"DCCC"
EndIf
IfCharIs "9"
"CM"
EndIf
IfCharIs "0"
ClearClipboard
EndIf
Key HOME
StartSelect
Key END
Copy
EndSelect
CloseFile NoSave
Code: Select all
NewFile
Paste
EndSelect
Key END
StartSelect
Key LEFT ARROW
OverStrikeMode
IfCharIs "1"
"M"
EndIf
IfCharIs "2"
"MM"
EndIf
IfCharIs "3"
"MMM"
EndIf
IfCharIs "4"
"(IV)"
EndIf
IfCharIs "5"
"(V)"
EndIf
IfCharIs "6"
"(VI)"
EndIf
IfCharIs "7"
"(VII)"
EndIf
IfCharIs "8"
"(VIII)"
EndIf
IfCharIs "9"
"(IX)"
EndIf
IfCharIs "0"
ClearClipboard
EndIf
Key HOME
StartSelect
Key END
Copy
EndSelect
CloseFile NoSave
Best regards,
PoorPatriot