[Mumps2Py:] [109] added Mf_select()

[ Thread Index | Date Index | More lists.mumps2py.org/discuss Archives ]


Revision: 109
Author:   pgallot
Date:     2008-02-14 15:35:12 +0000 (Thu, 14 Feb 2008)

Log Message:
-----------
added Mf_select()

Modified Paths:
--------------
    trunk/mumps2py/mumpsCL.py


Modified: trunk/mumps2py/mumpsCL.py
===================================================================
--- trunk/mumps2py/mumpsCL.py	2008-02-13 23:17:19 UTC (rev 108)
+++ trunk/mumps2py/mumpsCL.py	2008-02-14 15:35:12 UTC (rev 109)
@@ -75,6 +75,14 @@
     else:
         return val + len(substr) + 1
 
+
+def Mf_select(testlist):
+    """Python-equivalent of the Mumps $Select intrinsic"""
+    for testcase, value in testlist:
+        if testcase:
+            return value
+    return False
+
 def Mf_translate(input_str, subst_str = None, repl_str = None):
     """Python-equivalent of the Mumps $Translate intrinsic"""
     subst_dict = {}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/