There is a way to convert ‘array of const’ (open array) to TValue: Asbjørn Heid found one.

So the solution I came up with is to use the observation that the “array of const” is “array of TVarRec”, and that “array of TVarRec” is passed as as two arguments: a pointer to the data and the length of the array (or rather, the highest index in the array).