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

viktoras d. viktoras at ekoinf.net
Thu Feb 5 04:41:31 EST 2009


small correction: \s is same as [ \t\f\r\n], and \S is opposite to \s.

viktoras d. wrote:
> there is:
>
>   if matchText(fld "fText", "\S") is false then
>      answer "no text in field"
>   end if
>
> This one checks for any symbols that are not "whitespace" of any kind 
> (\S is same as [ \t\f\r\n]).
>
> Viktoras
>
> Bob Sneidar wrote:
>> I wonder, isn't there a way to use regular expressions to check for 
>> white space?
>>
>> Bob Sneidar
>> IT Manager
>> Logos Management
>> Calvary Chapel CM
>>
>> On Feb 3, 2009, at 6:18 AM, Andre.Bisseret wrote:
>>
>>> Bonjour,
>>>
>>> I need to test if a given list field in a stack contains some values
>>> or if it is empty.
>>> Well, by "empty" I mean that the field contains not any word or
>>> number. But it happens that it may include carriage returns and/or 
>>> tabs.
>>> In such cases :
>>> field "thisField" is empty
>>> return false.
>>>
>>> If there were only carriage returns, I could test if each line of the
>>> field is empty;
>>> indeed :
>>> line x of fld "thisField" is empty
>>> returns true if the only character in the line is cr
>>> but returns false if there is at least one tab in the line.
>>>
>>> I just tried :
>>> if last char of fld "thisField" is empty  ;-))
>>>
>>> that seems working well ! but a bit strange and might be not reliable ?
>>>
>>> Is there a better trick ?
>>>
>>> Thanks for any idea
>>>
>>> Best regards from Grenoble
>>> André
>>> _______________________________________________
>>> 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
>>
>>
>> _______________________________________________
>> 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
>>
>
> _______________________________________________
> 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