As allways it's a PEBKAC problem

When (in Button1Clik) I hardcoded the PtrRec to point to a specific record in Options, instead of calling FindPascalRec(), all was OK.
So let's look at the definition of this function:
function FindPascalRec(Name: String; Options: TEPlusOptions): PHLAttrRec;
Options is passed by value. The consequence is that it retunrs a pointer to the local copy of AOptions somewhere on the (now invalidated) stack of that function.
Passing AOptions by reference solves the issue.
Initially I thought to make it a
constref parameter, but the
wiki states:
Note that in general, it should only be used for interfacing with external code or when writing assembler routines.
Hence I decided to make it a
var parameter, even though the function is not intended to alter the contents of the Options parameter.
Bart
PS. I can't add [Solved] to the subject line, because of length limitations on the subject line, without altering the subject line in such a way that it would no loger reflect the original question.