Throw me a frikkin bone
Posted: Sat Apr 19, 2025 8:14 am
Why is this NOT replacing every 'ѧ' with an image?
-
-
A forum for xTalk discussion
https://www.openxtalk.org/forum/
That's more like a work around, 'replace' should replace every occurrence of your target unicode character in the field without that repeat loop.richmond62 wrote: ↑Sat Apr 19, 2025 1:00 pm Obviously too much to expect someone to help.
-
Screenshot 2025-04-19 at 15.58.28.jpg
Code: Select all
if fld "DICK" contains "(constant)" then
replace "(constant)" with (cr & numToCodePoint(1133) && "constant" & cr) in fld "DICK"
set the caseSensitive to true
repeat for each item MAGIC in "constant"
put wordoffset(MAGIC , fld "DICK") into WITCH
set the textColor of word WITCH of fld "DICK" to red
end repeat
put 1 into CYCLE
repeat until CYCLE > GLYPHS
if char CYCLE of fld "DICK" = numToCodePoint(1133) then
set the imageSource of char CYCLE of fld "DICK" to 1365
end if
add 1 to CYCLE
end repeat
end if
Code: Select all
if fld "DICK" contains "(keyword)" then
replace "(keyword)" with (cr & numToCodePoint(1134) && "keyword" & cr) in fld "DICK"
set the caseSensitive to true
repeat for each item MAGIC in "keyword"
put wordoffset(MAGIC , fld "DICK") into WITCH
set the textColor of word WITCH of fld "DICK" to red
end repeat
put 1 into CYCLE
repeat until CYCLE > GLYPHS
if char CYCLE of fld "DICK" = numToCodePoint(1134) then
set the imageSource of char CYCLE of fld "DICK" to 1369
end if
add 1 to CYCLE
end repeat
end if
Code: Select all
on mouseup
if fld "GUFF" contains "cheese" then
replace "cheese" with (numToCodePoint(1127) && "cheese") in fld "GUFF"
set the caseSensitive to true
repeat for each item MAGIC in "cheese"
put wordoffset(MAGIC , fld "GUFF") into WITCH
set the textColor of word WITCH of fld "GUFF" to red
end repeat
put 1 into CYCLE
repeat until CYCLE > 1000
if char CYCLE of fld "GUFF" = numToCodePoint(1127) then
set the imageSource of char CYCLE of fld "GUFF" to 1007
end if
add 1 to CYCLE
end repeat
end if
----
if fld "GUFF" contains "fan" then
replace "fan" with (numToCodePoint(1128) && "fan") in fld "GUFF"
set the caseSensitive to true
repeat for each item MAGIC in "fan"
put wordoffset(MAGIC , fld "GUFF") into WITCH
set the textColor of word WITCH of fld "GUFF" to purple
end repeat
put 1 into CYCLE
repeat until CYCLE > 1000
if char CYCLE of fld "GUFF" = numToCodePoint(1128) then
set the imageSource of char CYCLE of fld "GUFF" to 1011
end if
add 1 to CYCLE
end repeat
end if
end mouseup
Code: Select all
on mouseup
put the htmlText of fld "GUFF" into GUPH
replace "cheese" with "<font color=" & quote & "red" & quote & ">cheese</font>" in GUPH
replace "fan" with "<font color=" & quote & "purple" & quote & ">fan</font>" in GUPH
set the htmlText of fld "GUFF" to GUPH
end mouseup
Code: Select all
on mouseup
if fld "GUFF" contains "cheese" then
replace "cheese" with (numToCodePoint(1127) && "cheese") in fld "GUFF"
end if
if fld "GUFF" contains "fan" then
replace "fan" with (numToCodePoint(1128) && "fan") in fld "GUFF"
end if
put the htmlText of fld "GUFF" into GUPH
replace "cheese" with "<font color=" & quote & "red" & quote & ">cheese</font>" in GUPH
replace "fan" with "<font color=" & quote & "purple" & quote & ">fan</font>" in GUPH
set the htmlText of fld "GUFF" to GUPH
end mouseup
Code: Select all
on mouseup
if fld "GUFF" contains "cheese" then
replace "cheese" with (numToCodePoint(1127) && "cheese") in fld "GUFF"
end if
if fld "GUFF" contains "fan" then
replace "fan" with (numToCodePoint(1128) && "fan") in fld "GUFF"
end if
----
put the htmlText of fld "GUFF" into GUPH
replace "cheese" with "<font color=" & quote & "red" & quote & ">cheese</font>" in GUPH
replace "fan" with "<font color=" & quote & "purple" & quote & ">fan</font>" in GUPH
set the htmlText of fld "GUFF" to GUPH
----
put the number of chars in fld "GUFF" into GNUM
put 1 into CYCLE
repeat until CYCLE > GNUM
if char CYCLE of fld "GUFF" = numToCodePoint(1127) then
set the imageSource of char CYCLE of fld "GUFF" to 1007
end if
if char CYCLE of fld "GUFF" = numToCodePoint(1128) then
set the imageSource of char CYCLE of fld "GUFF" to 1011
end if
add 1 to CYCLE
end repeat
end mouseup