Helgef wrote: .
jeeswg wrote: .
@Helgef, While + RegExMatch using StartPos + RegExReplace = worked wonderfully! (Very Straightforward!)
@jeeswg, below is a script example
# is a special character, ## represents a literal # character (it means that the first # escapes the second #)
#AnyNumber# is a special string (Example: #65# = A, #66# = B, in the other hand, ##65## = #65#, ##66## = #66#)
#AnyNumber# is automatically converted to its correspondent unicode character!
The script example works in real time, while typing or copy/pasting text, the output result is updated in real time!
May contain bugs, I don't know, the script may need more test!
Code: Select all
String := ""
. "--65--66--67--68-- __ --65666768--`r`n"
. "--##65##--##66##--##67##--##68##-- __ --##65####66####67####68##--`r`n"
. "--####65####--####66####-- __ --####65########66####--`r`n"
. "--#65#--#66#--#67#--#68#-- __ --#65##66##67##68#--`r`n"
gui, add, text, , Type or paste text below:
gui, add, edit, w450 H100 vEdit1 gUpdate WantTab, % String
gui, add, text, , OutPut:
gui, add, edit, w450 H100 vEdit2 +ReadOnly, % DecimalToChar(String)
gui, show
return
Update: ;__________ Update ______________
guicontrolget, Edit1
guicontrol, , Edit2, % DecimalToChar(Edit1)
return
guiclose: ;__________ Gui Close ______________
exitapp
DecimalToChar(Text) ;___________ DecimalToChar(Function) ________________
{
StartPos := 1
while, StartPos := RegExMatch(Text, "##(*SKIP)(*F)|#(\d+)#", Match, StartPos)
Text := RegExReplace(Text, "##(*SKIP)(*F)|" Match, Chr(Match1))
Text := RegExReplace(Text, "##", "#")
return, Text
}