<% def element0(var): """find the first element array""" parts = ["lbound(s%%%s, %d)" % (var["name"], i+1) for i in range(var["rank"])] if var["rank"] > 0: txt = "(" + ",".join(parts) + ")" else: txt = "" return txt %> ! if you want to reference a pointer variable ! you have to point to the first element %for variable in variables: <% rs = "c_loc(spointer%"+variable["name"]+element0(variable)+")" %> case ('${variable["name"]}') x = ${rs} %endfor ## vim: filetype=mako