The split was the only optimization I had discovered myself just before the
detailed answer of flyx.
But we do not need a template. This should work too:
var lookup_id, lookup_name_source: string
(lookup_id, lookup_name_source) = p.rowEntry(col).split('|')[0..1]
lookup_name_source = lookup_name_source.toUpperAscii
I would prefer this solution, it is simpler, no template involved. I think that
unfortunately both solutions do a full split and may generate a large temporary
array of strings, while only the first two are desired. And for toUpperAscii()
we may like to have a variant which works in place instead allocating a new
string.