Page 1 of 1

Bunging an image into a field

Posted: Sat Apr 19, 2025 9:16 am
by richmond62
The 'funny' thing about this (it isn't funny, it is a pain in the bum) is that my script is ONLY replacing the first occurrence of 'ѧ' with the image:
-
Screenshot 2025-04-19 at 11.10.39.jpg

Re: Bunging an image into a field

Posted: Sat Apr 19, 2025 9:44 am
by SparkOut
I don't see where you define "property" to loop through the magic items. That line just searches a string literal, which contains only a single item defined as "property" so nothing happens.

Re: Bunging an image into a field

Posted: Sat Apr 19, 2025 10:20 am
by richmond62
Yes: you are quite right: but this makes no difference:
-
Screenshot 2025-04-19 at 12.18.56.png

Re: Bunging an image into a field

Posted: Sat Apr 19, 2025 2:00 pm
by richmond62
Thanks for nothing.
-
Screenshot 2025-04-19 at 15.58.28.jpg

Re: Bunging an image into a field

Posted: Sat Apr 19, 2025 5:41 pm
by Klaus
richmond62 wrote:
Sat Apr 19, 2025 9:16 am
The 'funny' thing about this (it isn't funny, it is a pain in the bum) is that my script is ONLY replacing the first occurrence of 'ѧ' with the image:
Screenshot 2025-04-19 at 11.10.39.jpg
Make use of the third possible parameter for OFFSET -> skip
From "wordoffset":
...
For example, if the stringToSearch is "This is a test" and the wordToFind is "test", wordOffset(wordToFind,stringToSearch) returns 4. However, wordOffset(wordToFind, stringToSearch,3) returns 1, even though it is finding the same occurrence, because the first three words are skipped.
...

Re: Bunging an image into a field

Posted: Sat Apr 19, 2025 6:44 pm
by jacque
Also, you are only searching a single word "cheese" in the first repeat because it's a literal, so by default there is only one so-called item. You want to search the field content, and it would go faster if you put the text of the field into a variable.

Code: Select all

put the text of fld "gaff" into tText
put 0 into tSkip
If you would post the code as text instead of an image I could help rewrite the rest but I'm on a mobile device and it's too tedious to type it out. It's also too small to read comfortably.