Missing method in System.Variants

I have declared System.Variants in Uses and LSP is happy with the following statement:

    WIDBCDS.Locate('StartTime;Title',VarArrayOf([x, y ]),[]);

But the compiler objects with error message:

[Error] CWRmainForm.pas(540): identifier not found "VarArrayOf"

So, I tried a lower-level approach to create the requisite variant array as follows. This also passed the LSP but failed the compiler:

var
  st: TDateTime;
  vals: Variant;
begin
...
    st := <a TDateTime> 
    vals := VarArrayCreate([0,1], varVariant);
    VarArrayPut(vals, st, [0]);
    VarArrayPut(vals, 'a string', [1]);
...
[Error] CWRmainForm.pas(532): identifier not found "Variant"

What am I doing wrong?

This is at this moment not yet in the pas2js RTL library provided by the pas2js team.
We'll check with the team on the status of this, whether there are perhaps technical limitations for bringing this Delphi function to the web.

Thanks, Bruno. I'll improvise using Filter statements.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.