You are not logged in.
Hi,
I have the follow code:
uses
...,
SynCommons,
....
procedure myProcedure(const FromNames, ToNames: TRawUTF8DynArray);
begin
DoSomething....;
end;
implementation
....
myProcedure(['Name1','Name2'],['ToName1', 'ToName2']); // here error on compiling
1) This is de correct way to invoke myProcedure???
2) If this is OK, then in Delphi7, Win7 32bits have de follow error on compilig:
[Error] TestProyect.dpr[xx]: Ordinal type required
What is wrong here?
Thanks.
Last edited by camu72 (2018-03-15 12:18:46)
Offline
the correct way:
var
lFromNames, lToNames: TRawUTF8DynArray;
begin
SetLength(lFromNames,2);
lFromNames[0] := 'Name1';
lFromNames[1] := 'Name2';
SetLength(lToNames,2);
lToNames[0] := 'ToName1';
lToNames[1] := 'ToName2';
myProcedure(lFromNames, lToNames);
end;
Esteban
Offline
That's limitation of D7 (it works in newer Delphi versions).
Workaround is to call it as:
myProcedure(TRawUTF8DynArrayFrom(['Name1','Name2']), TRawUTF8DynArrayFrom(['ToName1', 'ToName2']));
Last edited by igors233 (2018-03-15 14:38:42)
Offline