Thanks! That's good to know. I can't quite figure out how to return the site with the lowest index in a given row. (min …) is binary, so it seems I have to iterate using (set Var …), like this maybe:
But then it seems that this has to be its own move. That is, I don't know how to set (var) as the first part of a decision move. Do I have to set the value and then moveAgain?
Edit: I think I'm even more confused than I thought, because I (think I) have to get at the lowest index of the row inside the context of (move <from> <to>), since the relevant row is the row of (from). Then (moveAgain) won't help me, and I'm back at having no idea.
Is there a way of wrapping something like this code up in a function that simply returns (var) so I can treat it like a value?
Code:
(set Var (from)
(then
(forEach sites
(sites Row (row of:(from)))
(set Var
(min (var) (site))
)
)
)
)
Edit: I think I'm even more confused than I thought, because I (think I) have to get at the lowest index of the row inside the context of (move <from> <to>), since the relevant row is the row of (from). Then (moveAgain) won't help me, and I'm back at having no idea.
Is there a way of wrapping something like this code up in a function that simply returns (var) so I can treat it like a value?