Call to all you one-liners !

Ken Ray kray at
Sat Jun 26 17:57:29 EDT 2010

FYI: ugly though it is, here's the regex (it's long, so I broke it up into
multiple statements):

function isAColor pRGB
  put "^([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])," & \
      "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])," & \
      "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$" into tRegEx
  return matchText(pRGB,tRegEx)
end isAColor

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at
Web Site:

On 6/26/10 2:10 PM, "Jim Ault" <jimaultwins at> wrote:

> The sum() function error could do this,
> but it will also work with real numbers, not just integers.
> On Jun 26, 2010, at 10:36 AM, J. Landman Gay wrote:
>> J. Landman Gay wrote:
>>> Mark Schonewille wrote:
>>>> Hi Francis,
>>>> put (fld 1 is a color and the number of items of fld 1 is 3) into
>>>> myIsRGB
>>> As mentioned, this is okay for a quick check but isn't very
>>> reliable in general. "Is a color" seems to return true for any
>>> comma-delimited list of integers, regardless of whether the numbers
>>> are within a valid color range.
>> I meant to add: it could be a quick way to check for any valid list
>> of item-delimited integers though. It's sort of a non-intuitive
>> approach, but faster than iterating through the list looking for non-
>> integer entries.
> Jim Ault
> Las Vegas
> _______________________________________________
> use-revolution mailing list
> use-revolution at
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:

More information about the Use-livecode mailing list