Bunging an image into a field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
- Posts: 10089
- Joined: Fri Feb 19, 2010 10:17 am
Bunging an image into a field
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:
-
-
Re: Bunging an image into a field
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.
-
- Livecode Opensource Backer
- Posts: 10089
- Joined: Fri Feb 19, 2010 10:17 am
Re: Bunging an image into a field
Yes: you are quite right: but this makes no difference:
-
-
-
- Livecode Opensource Backer
- Posts: 10089
- Joined: Fri Feb 19, 2010 10:17 am
Re: Bunging an image into a field
Make use of the third possible parameter for OFFSET -> skiprichmond62 wrote: ↑Sat Apr 19, 2025 9:16 amThe '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
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
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.
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.
Code: Select all
put the text of fld "gaff" into tText
put 0 into tSkip
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com