plcopen/structures.py
changeset 305 0ed2b61de43e
parent 284 6cf858411d3a
child 307 fd1f6ae26d4f
--- a/plcopen/structures.py	Fri Jan 16 13:22:07 2009 +0100
+++ b/plcopen/structures.py	Mon Jan 19 08:21:41 2009 +0100
@@ -34,8 +34,11 @@
                      "L" : ["LINT", "ULINT", "LREAL", "LWORD"]} 
 
 # Helper for emulate join on element list
-def JoinList(separator, list):
-    return reduce(lambda x, y: x + separator + y, list)
+def JoinList(separator, mylist):
+    if len(mylist) > 0 :
+        return reduce(lambda x, y: x + separator + y, mylist)
+    else :
+        return mylist
 
 def generate_block(generator, block, body, link, order=False):
     body_type = body.getcontent()["name"]