Bunging an image into a field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10089
Joined: Fri Feb 19, 2010 10:17 am

Bunging an image into a field

Post by richmond62 » 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

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Re: Bunging an image into a field

Post by SparkOut » Sat Apr 19, 2025 9:44 am

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.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10089
Joined: Fri Feb 19, 2010 10:17 am

Re: Bunging an image into a field

Post by richmond62 » Sat Apr 19, 2025 10:20 am

Yes: you are quite right: but this makes no difference:
-
Screenshot 2025-04-19 at 12.18.56.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10089
Joined: Fri Feb 19, 2010 10:17 am

Re: Bunging an image into a field

Post by richmond62 » Sat Apr 19, 2025 2:00 pm

Thanks for nothing.
-
Screenshot 2025-04-19 at 15.58.28.jpg

Klaus
Posts: 14181
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Bunging an image into a field

Post by Klaus » Sat Apr 19, 2025 5:41 pm

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.
...

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Bunging an image into a field

Post by jacque » Sat Apr 19, 2025 6:44 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply