I have this function, i can't convert the vtString and vtChar from Delphi 2006 to Delphi XE10.1 Berlin
also as you know vtString not supported after Delphi 2009, what will be alternative to it In Delphi XE 10.1 and how get it working in this function.
function checkval(const Values:array of const):boolean;
var
I:integer;
P:byte;
S:ShortString;
v,d:double;
OldPos:integer;
ls:boolean;
FISize,FISize2:byte;
FRecNo:integer;
begin
SetLength(s,FISize);
P:=1;
ls:=False;
SetLength(s,FISize); P:=1; ls:=False;
for I := 0 to High(Values) do
with Values do case VType of
vtString: // Short string (only the last field in index can be of ShortString type)
begin
S[P]:=AnsiChar (Length(VString^));
System.Move(VString^[1],S[P+1],Length(VString^));
Inc(P,Length(VString^)+1);
ls:=I=High(Values);
end;
vtChar:
begin
System.Move(VChar,S[P],SizeOf(VChar));
Inc(P,SizeOf(VChar));
end;
end;
if P<=FISize then
begin
if ls then
FillChar(S[P],FISize-P+1,#0)
else
MessageDlg('not valid size.', mtError, [mbOK], 0);
end
else if P>FISize+1 then
raise Exception.Create('Too many Find parameters.');
end;
Thank you for any help, I appreciate your time and knowledge , I don't understand explanation , if you can help please reply with complete code .