[Zope] Testing if a string isn't empty

Phil Harris phil.harris@zope.co.uk
Wed, 16 May 2001 13:32:42 +0100


My first take would be something like (untested):

<dtml-unless mc_name>
  <dtml-call "REQUEST.set('mc_name','Clipname')">
</dtml-unless>

Phil
----- Original Message ----- 
From: "Gitte Wange" <gitte@mmmanager.org>
To: <zope@zope.org>
Sent: Wednesday, May 16, 2001 1:22 PM
Subject: [Zope] Testing if a string isn't empty


> Hello,
> 
> I am trying to make some dtml code that tests if a string contains text 
> (because if the string is empty it must be set to contain 'Clipname').
> 
> Right now the code looks like this:
> <dtml-if expr="mc_name == ''">
>   <dtml-let mc_name="'Clipname'">
>    <dtml-call sqlAddClip>
>   </dtml-let>
> </dtml-if>
> 
> How do you do it - because the above doesn't work.
> 
> Regards,
> -- 
> ************************
> Gitte Wange Jensen
> 
> System Squid Developer
> MMManager Aps
> +45 29 72 79 72
> 
> gitte@mmmanager.org
> ************************
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )