This is a tough one for VCL and inline assembly gurus.
I need to dynamically create the Value parameter to pass to the Format function. (Or rewrite Format's existing functionality - ugh)
Review of common knowledge:
Format has the following declaration:
Function Format (const aFormat: String; const values: array of const);
The desired functionality is along the lines of:
function TMyRule.ResultString (fmt: String): String;
Params := BuildParams;
aString := Format (fmt, Params);
I have determined that the array of const is implemented as an array of TVarRec's. I am uncertain about whether it is actually a variant array or not. Either way, I can build it. Any input?
BUT ... there is no syntactic model to pass the created array to the function. The Pascal syntax only allows the array to be compiled in.
A review of the format function in SysUtils.pas suggests that it should be possible to write the call with an inline assembly call. This is the real meat of the problem.