How to test if a field does not contain anything else than returns or tab?

Andre.Bisseret Andre.Bisseret at inria.fr
Thu Feb 5 04:00:49 EST 2009


Very helpful indeed !
Always learning :-) I did not know that a non-breaking space was  
considered as a word !
Like St Thomas, I tried it and … you are right (of course ;-))
Yes, as you say,  it is unlikely (mainly due to the fact that one use  
two keys to type a non-breaking space)
  but sure your function trim is a prudent precaution.

Thanks a lot Ken

André


Le 4 févr. 09 à 19:00, Ken Ray a écrit :

>
>
>
> On 2/4/09 8:41 AM, "Andre.Bisseret" <Andre.Bisseret at inria.fr> wrote:
>
>> Hello
>> Thanks to all who paid attention to my question
>> Quite a nice number  of ways (mainly variations around counting the
>> number of words)
>
> BTW, just for 100% clairty, none of these "word-based" approaches  
> work if
> there is a non-breaking space (  or  ) in the field.   
> Admittedly,
> the possibility of this happening is extremely low, but to be on the  
> safe
> side, this is "trim" function I use:
>
> function trim what
>  if the platform is "MacOS" then
>    replace numToChar(202) with " " in what
>  else
>    replace numToChar(160) with " " in what
>  end if
>  return (word 1 to -1 of what)
> end trim
>
> So for testing an empty field, it would be:
>
>  if trim(fld 1) = "" then
>
> HTH,
>
> Ken Ray
> Sons of Thunder Software, Inc.
> Email: kray at sonsothunder.com
> Web Site: http://www.sonsothunder.com/
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>





More information about the use-livecode mailing list