Hello All, I would like to declare a multidimension array of constant values. I want to do something like this: const A: Array[1.2,1.2] of real = ( 1.0,2.0.

Hello, I'm trying to accomplish a serialize/unserialize function for data. I would like a function which takes an array of variables of different types and makes a string out of them and a functino that does the reverse, takes in a string and sets the variables in the array to their respective values. The following is what I've come up with sofar, unfortunately it does not work as intended; the variable s1 is unchanged after the call to HUnpack2. Is there a way to remedy this or is this 'impossible' in delphi/pascal? Quote In article, Hugo Hallqvist wrote: > I'm trying to accomplish a serialize/unserialize function for data.
Delphi Const Array
I > would like a function which takes an array of variables of different > types and makes a string out of them and a functino that does the > reverse, takes in a string and sets the variables in the array to their > respective values. > The following is what I've come up with sofar, unfortunately it does not > work as intended; the variable s1 is unchanged after the call to > HUnpack2. Is there a way to remedy this or is this 'impossible' in > delphi/pascal? The array of const/TVarRec construct is really intended to be used by the compiler (creating array of TVarrecs on the fly), they are definitely not intended to by used as Var parameters. Especially the handling of Ansistring values is difficult to get right yourself since the TVarrec mechanism bypasses reference counting.