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 <[email protected]>
To: How to use LiveCode <[email protected]>
Cc: Rick Harrison <[email protected]>
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
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to