Parameter checking
Dave Cragg
dcragg at lacscentre.co.uk
Tue Jul 5 06:07:13 EDT 2005
On 5 Jul 2005, at 03:21, Ken Ray wrote:
>
> So, for example, if you are checking to see if p1 is between A and
> P (case
> insensitive), you can do this:
>
> if not matchText(p1,"(?i)[A-P]") then exit to top
>
> OR this:
>
> if not matchText(p1,"[A-Pa-p]") then exit to top
Ken, I think you need to make it like this:
if not matchText(p1,"^[A-Pa-p]$") then exit to top
Otherwise it will match strings that contain the target character,
which I don't think is what Sarah wants.
e.g. 123B will pass the test.
So for the other examples
if not matchText(p2,"^[1-8]$") then exit to top
if not matchText(p3,"^[SD]$") then exit to top -- note s,d won't
match
if not matchText(p3,"(?i)^[SD]$") then exit to top -- matches SDsd
if not matchText(p3,"^[SDsd]$") then exit to top -- matches SDsd
Cheers
Dave
More information about the use-livecode
mailing list