[Zope] How to concatenate variables

McDonnell, Larry lmcdonnell@protonenergy.com
Fri, 14 Jun 2002 16:18:05 -0400


Ok, how do you use <dtml-in concat_sub_type_to_part_num(st1,sub_type2)>? I
keep getting a key error. Can you use a python script passing variables in a
dtml-in statement?

-----Original Message-----
From: Dieter Maurer [mailto:dieter@handshake.de]
Sent: Friday, June 14, 2002 3:05 PM
To: McDonnell, Larry
Cc: 'Zope@Zope. Org' (E-mail)
Subject: Re: [Zope] How to concatenate variables


McDonnell, Larry writes:
 > I am having problems concatenating variables. I have seven pull down
menus.
 > Selecting one from each menu will create a part number. I setup a test to
 > see if this would work. I have one dtml doc with the menus. After a
submit
 > it calls this dtml doc:
 > 
 > <form name="form1" method="post" action="">
 > <dtml-let pn="' ' ">
 > <dtml-call concat_sub_type_to_part_num(st1,sub_type2)>
 > <dtml-var st1>st1<dtml-var sub_type2>st2
 > <dtml-var expr="pn==st1+sub_type2">
 > <dtml-var pn> pn
 > </dtml-let>
 > </form>
 > 
 > I call a python script concat_sub_type_to_part_num and pass two of the
menu
 > selections in this test. I tried to concat there but no luck. I can only
see
 > the variables I passed.
Functions are unable to change strings in the callers context.

  You need to return the concatenated value.
  And you must not use "dtml-call" in this case, as it discards the return
  value.


Dieter