What is after what?

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: 10096
Joined: Fri Feb 19, 2010 10:17 am

What is after what?

Post by richmond62 » Mon Aug 01, 2022 1:16 pm

I am poking around in fields . . .

Code: Select all

on mouseUp
if fld "ff" contains "L" then
put the char after char "K" in fld "ff"
end if
end mouseUp
Does not work . . .

So, I would be grateful if someone could help me to detect
the character after another character in a field.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: What is after what?

Post by dunbarx » Mon Aug 01, 2022 2:38 pm

Richmond.

Your syntax is all wrong. There is no construction in LC to "put the char after char..."

You just made that up.

Something like this:

Code: Select all

put char offset("K",fld "ff") + 1 of fld "ff"
Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: What is after what?

Post by dunbarx » Mon Aug 01, 2022 2:43 pm

Richmond.

This last will only find the char following the first instance of a "K". Is that enough?

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: What is after what?

Post by dunbarx » Mon Aug 01, 2022 2:45 pm

Richmond.

I am starting to post like you do. :wink:

Let me know if you need to find all the chars following ALL the "K"s

Craig

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

Re: What is after what?

Post by richmond62 » Mon Aug 01, 2022 2:50 pm

Experiencing internet probs right now, so will do as
you suggest and revert just as soon as internet sorted out.

Telephone uses different ISP to our computers . . .

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

Re: What is after what?

Post by richmond62 » Mon Aug 01, 2022 3:10 pm

Of course I made that up, but at least it sufficed
enough for you to understand what I wanted tdo.

AND your code works perfectly.

Thank you very much indeed.

Post Reply