[Zope] variable assignment

Charlie Reiman creiman@kefta.com
Tue, 22 Oct 2002 09:21:57 -0700


dtml-let almost certainly won't do what you want since it sounds like you
want the value outside of the dtml-in. This would require improper nesting.
Oh sure, improper nesting sounds like fun but it is illegal.

<dtml-in yadda>
<dtml-let foo=sequence-item>
</dtml-in>     <!-- boom -->
<dtml-var foo> <!-- you won't even get here. -->
</dtml-let>    <!-- or here for that matter -->

You can:

1) Use REQUEST.set as Andreas noted. Ugly but available everywhere.
2) Install dtml-set. Inexplicably never made part of zope proper but really
ought to be.

I'd suggest #2.

> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Andreas Jung
> Sent: Tuesday, October 22, 2002 5:57 AM
> To: Micheál Healy; zope@zope.org
> Subject: Re: [Zope] variable assignment
>
>
> Either use dtm-let or assign the variable to the REQUEST
> object using REQUEST.set() (ugly).
>
> -aj
>
> --On Dienstag, 22. Oktober 2002 13:52 +0100 Micheál Healy
> <michael.healy@engitech.ie> wrote:
>
> >
> > Hi,
> >
> > I have the following code snippet:
> >
> >   <dtml-in
> > expr="view.sql_query_current_windows_version(p_custName=p_custName,
> > p_inventory=p_inventory)">       <dtml-var current_windows_version>
> >   </dtml-in>
> >
> > I'd like to be able to check the value of 'current_windows_version'
> > (which is sel in the ZSQL method) later in the code.  Is there
> any way of
> > assigning this value to a 'global' variable which I could read later?
> > TIA,
> >
> > Micheál Healy
>
>
>
>
>     ---------------------------------------------------------------------
>    -    Andreas Jung                     http://www.andreas-jung.com   -
>   -   EMail: andreas at andreas-jung.com                              -
>    -            "Life is too short to (re)write parsers"               -
>     ---------------------------------------------------------------------
>