Two functions ctot and ttoc are written.
Function ctot $ (ccstr $)
Dim I %, J %, N %, M %, T ()
If ccstr = "" Then exit function
If instr (ccstr, "CHR (") = 0 or instr (ccstr, ")") = 0 Then exit function
Ccstr = Replace (ccstr, "CHR ","")
Ccstr = Replace (ccstr, "+ ","")
I = Len (ccstr)-len (replace (ccstr ,"(",""))
J = Len (ccstr)-len (replace (ccstr ,")",""))
N = IIF (I> J, J, I)
'The above is a canonicalized and formatted string.
Redim T (1 to n)
I = 1: j = 1
For M = 1 to n
I = instr (J, ccstr ,"(")
J = instr (I + 1, ccstr ,")")
T (m) = CHR (mid (ccstr, I + 1, J-I-1 ))
Next
Ctot = join (T ,"")
End Function
Function ttoc $ (txtstr $)
Dim I %, N %, C ()
N = Len (txtstr)
If n <> 0 then
Redim C (1 to n)
For I = 1 to n
C (I) = ASC (mid (txtstr, I, 1 ))
Next
Ttoc = "CHR (" & join (C, ") + CHR (")&")"
End if
End Function
Private sub text=change ()
Text2 = ctot (text1)
End sub
Private sub text2_change ()
'Text1' = ttoc (text2)
'Two cannot be used at the same time. Haha, or two text boxes will be reversed.
'You can add a text3 to get it.
'The input content in 1 is CHR to 3
'Input in 2, ASC to 3
End sub