It always returns a 111. Is the case statement evaluating the first line and not the rest? I am trying to use a flex repeaters input params to change a labels text.
I would do the same but with a divider between the 2 numbers such as a | or , so that 1 and 11 don't evaluate the same as 11 and 1 for any future addition to the case statement. Instead you would get 1|11 and 11|1
Another way would be to maintain a top level dictionary in a project script which would take the numbers and find the matching dictionary key then return the value. The expression would use runScript(), that way you could change your lookup dictionary without modifying your expression bindings.
that would look like this
someProject //script package name
myDict = {"11|1":111}
def lookupOnLinePos(line,pos):
key = '%s|%s' % (line,pos)
return myDict.get(key,999)
//in the expression
runScript("myProject.lookupLinePos",
0, //only run when parameters change (poll off)
{view.params.Line},
{view.params.Pos}
)