True. I could have made it simpler even with ifs by doing something like you:
Then I could have used this trick with the select like you. I say trick just because it relies on the way Select are handled (ie by testing SEQUENTIALLY EACH case value against the select value until one matches, in the order the case are given - ie unlike in most programmming languages where the case values must be constants, and where jump tables are often used to directly jump to the right case).
But I just realized that this behaviour is documented so in fact it's safe to use it.
Anyway I definitely like your method for the reading comfort you get with it.
If (Object.ASS(what)<> Null) Then MyBottom.ASS = Object.ASS(what) ... ElseIf (Object.NOSE(what)<> Null) Then MyNose.NOSE = Object.NOSE(what) ... EndIfBut then I would have to do use Object twice more. And I think Object is little bit slow when you use Handle with a lot of objects because I believe it uses an associative container to keep track of the handle<->object association (so the conversion takes time - I have not tested how much time it can take though).
Then I could have used this trick with the select like you. I say trick just because it relies on the way Select are handled (ie by testing SEQUENTIALLY EACH case value against the select value until one matches, in the order the case are given - ie unlike in most programmming languages where the case values must be constants, and where jump tables are often used to directly jump to the right case).
But I just realized that this behaviour is documented so in fact it's safe to use it.
Anyway I definitely like your method for the reading comfort you get with it.