[Pas2js] How to pass an unknown record to a function as argument?
nc-gaertnma at netcologne.de
Mon Jun 15 16:07:07 CEST 2020
On Mon, 15 Jun 2020 05:49:46 -0700 (MST)
warleyalex via Pas2js <pas2js at lists.freepascal.org> wrote:
> JRec = record
> TProcColumnNameParams = procedure(columnName: @record);
> Of course this not work, I want to write a function and allow the
> user of the function to pass a record that I do not know in advance.
> Then, the idea is to show the columnNames (code autocompletion) of an
> unknown DB table.
> How to pass an unknown record to a function as argument?
You can pass any record to untyped, pointer, JSValue and TJSObject:
procedure Run(var r; p: Pointer; j: JSValue, o: TJSObject);
var a: JRec;
Run(a, at a,a,a);
More information about the Pas2js