DeveloppeurPascal / DeepL4Delphi

Delphi library and sample projects for using the translation API provided by DeepL.com
https://deepl4delphi.developpeur-pascal.fr
GNU Affero General Public License v3.0
17 stars 7 forks source link

Compiling with Delphi 10.0 Seattle #6

Open jrathlev opened 1 year ago

jrathlev commented 1 year ago
  1. TStringList.AddPair is not available in Delphi 10.0 Seattle.

Proposed workaround:

{$IF CompilerVersion <31.0}  // 10.1 Berlin
type
  TStringListHelper = class helper for TStringList
    function AddPair (const AName,AValue : string) : integer;
    end;

{ ------------------------------------------------------------------- }
function TStringListHelper.AddPair (const AName,AValue : string) : integer;
begin
  Result:=Add(AName+NameValueSeparator+AValue);
  end;
{$ENDIF}
  1. TJsonArray has no default property

Propsed change:

JSO2 := JSA.Items[0] as tjsonobject;

DeveloppeurPascal commented 1 year ago

Thanks, I'll install a Seattle on a VM and will update the library soon.