1 of 1 people found this helpful
Not sure if it would be faster, but getting a variable of List(PGM_SSN::id) , then use a custom function like this:
to return the position in the list that matches. Again, not sure if it would be any faster, but it would be a lot less code lines. Also I would sort the relationship instead of the portal, and it wouldn't quite work if you have portal filtering turned on (would need to filter the relationship instead).
Go to Portal Row[First]
Exit Loop If [ PGM_SSN::id = PGM::CURRENT SESSIONID ]
Go to Portal Row[Next ; Exit After last ]
Thanks, Mike and David, for these helpful suggestions. Both work fine, and are obviously more efficient than my original method. Any speed difference is imperceptible. So which one to use? Well I've gone for David's, simply because it's more obvious what's happening, for the person who has to pick this up when I get knocked off my bicycle on the way to work. And the limitation of not being able to filter the portal, whilst not an issue now, may trip me up later on.