I have about 6 or so dynamic properties(type float) which are linked to other properties on the window. How do I find the max value among the 6 and then subtract the rest from it. I know expression has a max function but it needs a dataset to be fed, so If I have to use that then how do I put these 6 or so properties into a dataset? I also know that python has a max function, but than how do I use it here even if I create a 7th dynamic property lets say max to store the maximum value?
Oh man, there’s an easier way that I just thought of…
Separately Qurban had asked me if there was a way to run jython in an expression, and I said no… but I lied. There’s actually a fairly new function called runScript that will do it. And conveniently, python has a max function.
So, you could so something like the following in an expression:
This just has 2 properties on a text box. So the trick is runScript just takes a string, in this case “max(a,b,c)”. You can’t refer to a dynamic property in a string, so you have to concat them together (could use “+”, but I thought “concat” was cleaner in this case).
I agree that the built in functions should handle this case, but at least this is easier than Nathan’s solution!