Wildcard? replaceText, offset?

dunbarx at aol.com dunbarx at aol.com
Sun Apr 26 15:08:52 EDT 2020


Or, more oil-fashioned, and again assuming that the integer in question is always the very first one in parentheses:
on mouseUpput random(99) into char offset("(",yourString) + 1 of yourStringend mouseUp
You will get tired of running this after only a few invocations.
Craig

-----Original Message-----
From: Rick Harrison via use-livecode <use-livecode at lists.runrev.com>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Cc: Rick Harrison <harrison at all-auctions.com>
Sent: Sun, Apr 26, 2020 2:26 pm
Subject: Wildcard? replaceText, offset?

I have a very long string.

In the middle-end part of the string I have “(x)” where x represents some integer.
it could be (4) or (10) or (5) etc.

I just want to replace the number inside the () with whatever other number I need to.

I have been trying to find an easy way to do this.  Ideally a wildcard character like ? or *
would probably do it, but after going through the dictionary and getting lost with
filter, matchText, …  I finally decided perhaps one of you could make a better
suggestion.  It seems like this one should be very easy, but it’s not so easy if you
don’t do this kind of thing all the time.

Thanks,

Rick
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list