Apologies, my mail client mangled the code, it should read:

foreach {var elem} [var all] {
  if {[info exists response(__$var)]} {
    # we have seen var multiple times already, add to the list:
    lappend response($var) $elem
  } elseif {[info exists response($var)]} {
    # second occurence of var, convert response(var) to a list:
    set response($var) [list $response($var) $elem]
    set response(__$var) ""
  } else {
    # first time seeing this var
    set response($var) $elem
  }
}

-fr.

-- 
Feargal Reilly, Chief Techie, FBI.
PGP Key: 0xBD252C01 (expires: 2006-11-30)
Web: http://www.fbi.ie/ | Tel: +353.14988588 | Fax: +353.14988489
Communications House, 11 Sallymount Avenue, Ranelagh, Dublin 6.


-- 
Feargal Reilly.
PGP Key: 0x679DB84D (expires: 2007-11-30)
Web: http://www.helgrim.com/ | ICQ: 109837009 | YIM: ectoraige
Visit http://ie.bsd.net/ - BSDs presence in Ireland

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to