Hello,
I can not use the statement VarArrayOf. I included System.Variants to my uses, but I get the error: identifier not found "VarArrayOf".
Can you support me?
Many Thanks
Patrick
Do you have any help in Delphi? System.Variants
No, I only get the message from the compiler: identifier not found "VarArrayOf"
This is the procedure where I use it:
procedure TLogic.Locate_DS(DSet: TXDataWebDataSet; WAAUNR, WATENR,
OAAGNR: string);
begin
DSet.Locate('waaunr;watenr;oaagnr', VarArrayOf([WAAUNR, WATENR, OAAGNR]), [loCaseInsensitive]);
end;
There is at this moment at pas2js compiler RTL level no VarArrayOf() function.
Ok, thanks for the info. Is there another possibilty to realize a TXDataWebDataSet.Locate with more than one searchfield?
wlandgraf
(Wagner Landgraf)
6
Just remove the VarArrayOf and pass the array itself. Locate expects a value or an array of values.
Hi Wagner,
thanks for support! I try it on this way:
procedure TForm_NMain.btn_Start_SucheClick(Sender: TObject);
var
uID: integer;
uName: string;
begin
uID:=5;
uName:='Simone Seliger';
Data_Module.xDST_Vertreter.Locate('userid, Name',[uID, uName], [loCaseInsensitive]);
ShowMessage(Data_Module.xDST_Vertreter.FieldByName('as400kz').AsString);
end;
Can you tell me, what I do wrong? The compile tells me an error:
[Fehler] Form_NMainUnit.pas(265): Incompatible types: got "set or array literal" expected "JSValue"
Many thanks
Patrick
wlandgraf
(Wagner Landgraf)
8
You can try it this way:
procedure TForm_NMain.btn_Start_SucheClick(Sender: TObject);
var
KeyValues: array of JSValue;
begin
SetLength(KeyValues, 2);
KeyValues[0] := 5;
KeyValues[1] := 'Simone Seliger';
Data_Module.xDST_Vertreter.Locate('userid, Name',KeyValues, [loCaseInsensitive]);
ShowMessage(Data_Module.xDST_Vertreter.FieldByName('as400kz').AsString);
end;
Wagner R. Landgraf2019-12-12 15:57:31
I am sorry, but that doesn't works. Iget the error:
ERROR
xDST_Vertreter : Field not found : "userid, Name" | fMessage::xDST_Vertreter : Field not found : "userid, Name" fHelpContext::0