Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Integrating TextMagic API


This question is not answered. Helpful answers available: 0. Correct answers available: 1.


Permlink Replies: 5 - Last Post: Jan 30, 2018 10:24 AM Last Post By: Jim Sawyer
Jim Sawyer

Posts: 214
Registered: 1/3/10
Integrating TextMagic API  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 9, 2018 4:39 PM
Does anyone have code samples that integrate the TextMagic API with
Delphi 10? I just need something to learn from,

Jim Sawyer
Aloe Luigi

Posts: 1
Registered: 10/11/13
Re: Integrating TextMagic API
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 9, 2018 4:56 PM   in response to: Jim Sawyer in response to: Jim Sawyer
Jim Sawyer

Posts: 214
Registered: 1/3/10
Re: Integrating TextMagic API  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 11, 2018 3:37 AM   in response to: Aloe Luigi in response to: Aloe Luigi

I have already seen this document and perhaps I should look at it in a bit
more detail. I was hoping, however for some code samples some had
developed for their own project.

I tried the TextMagic delphi wrapper, and it had errors. I contacted
TeleMagic and they said it had not been updated for Delphi 10. They
suggested that I switch to Delphi XE7! That ain't hapening. Has
anyone got more and betterinformation on this situation?

Thanks,
Jim Sawyer
Eivind Bakkestuen


Posts: 447
Registered: 5/8/01
Re: Integrating TextMagic API
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 11, 2018 6:28 PM   in response to: Jim Sawyer in response to: Jim Sawyer
I tried the TextMagic delphi wrapper, and it had errors. I contacted
TeleMagic and they said it had not been updated for Delphi 10. They
suggested that I switch to Delphi XE7! That ain't hapening. Has
anyone got more and betterinformation on this situation?

If it works in XE7, changes to make it work in Tokyo would likely be
trivial. If you post more details about the errors, perhaps assistance
might get it working?

--
Eivind Bakkestuen [NDD]
Jim Sawyer

Posts: 214
Registered: 1/3/10
Re: Integrating TextMagic API  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 22, 2018 4:09 AM   in response to: Eivind Bakkestuen in response to: Eivind Bakkestuen
Good idea. Thanks. It will be a couple weeks before I'm back on that
project. I will do that then.

Jim Sawyer

Eivind Bakkestuen wrote:
I tried the TextMagic delphi wrapper, and it had errors. I contacted
TeleMagic and they said it had not been updated for Delphi 10. They
suggested that I switch to Delphi XE7! That ain't hapening. Has
anyone got more and betterinformation on this situation?

If it works in XE7, changes to make it work in Tokyo would likely be
trivial. If you post more details about the errors, perhaps assistance
might get it working?

--
Eivind Bakkestuen [NDD]
Jim Sawyer

Posts: 214
Registered: 1/3/10
Re: Integrating TextMagic API  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 30, 2018 10:24 AM   in response to: Eivind Bakkestuen in response to: Eivind Bakkestuen
The TextMagic wrapper gives the following errors in Delphi 10.2.

function SA(const Args: array of const): ISuperArray;
var
  I: Integer;
  SArray: ISuperArray;
  SObject: ISuperObject;
begin
  Result := TSuperArray.Create;
  for I := 0 to High(Args) do
      case PVarRec(@Args[I]).VType of
          vtInteger : Result.Add(TJSONInteger.Create(PVarRec(@Args[I]).VInteger));
          vtInt64   : Result.Add(TJSONInteger.Create(PVarRec(@Args[I]).VInt64^));
          vtBoolean : Result.Add(TJSONBoolean.Create(PVarRec(@Args[I]).VBoolean));
          {$IFNDEF NEXTGEN}
          vtChar    : Result.Add(TJSONString.Create(PVarRec(@Args[I]).VChar));
          vtString  : Result.Add(TJSONString.Create(PVarRec(@Args[I]).VString^));
          vtPChar   : Result.Add(TJSONString.Create(PVarRec(@Args[I]).VPChar^));
          vtAnsiString: Result.Add(TJSONString.Create(AnsiString(PVarRec(@Args[I]).VAnsiString)));
          {$ENDIF}
          vtWideChar: Result.Add(TJSONString.Create(PVarRec(@Args[I]).VWideChar));
          vtExtended: Result.Add(TJSONFloat.Create(PVarRec(@Args[I]).VExtended^));
          vtCurrency: Result.Add(TJSONFloat.Create(PVarRec(@Args[I]).VCurrency^));
          vtWideString: Result.Add(TJSONString.Create(PWideChar(PVarRec(@Args[I]).VWideString)));
          vtUnicodeString: Result.Add(TJSONString.Create(String(PVarRec(@Args[I]).VUnicodeString)));
          vtInterface:
            if PVarRec(@Args[I]).VInterface = nil then
               Result.Add(TJSONNull.Create(False))
            else if IInterface(PVarRec(@Args[I]).VInterface).QueryInterface(ISuperObject, SObject) = 0 then
                Result.Add(SObject)
            else if IInterface(PVarRec(@Args[I]).VInterface).QueryInterface(ISuperArray, SArray) = 0 then
                Result.Add(SArray)
            else
                Assert(False);
          vtPointer :
            if PVarRec(@Args[I]).VPointer = nil then
               Result.Add(TJSONNull.Create(False))
            else
               Result.Add(TJSONInteger.Create(PtrInt(PVarRec(@Args[I]).VPointer)));
          vtVariant:
            Result.Add(PVarRec(@Args[I]).VVariant^);
          vtObject:
            if PVarRec(@Args[I]).VPointer = nil then
               Result.Add(TJSONNull.Create(False))
            else
               Result.Add(TJSONInteger.Create(PtrInt(PVarRec(@Args[I]).VPointer)));
          vtClass:
            if PVarRec(@Args[I]).VPointer = nil then
               Result.Add(TJSONNull.Create(False))
            else
               Result.Add(TJSONInteger.Create(PtrInt(PVarRec(@Args[I]).VPointer)));
          else
            Assert(false);
      end;
end;


Line
vtChar : Result.Add(TJSONString.Create(PVarRec(@Args[I]).VChar));
has error
W1057 Implicit string cast from 'AnsiChar' to 'string'

line
vtString : Result.Add(TJSONString.Create(PVarRec(@Args[I]).VString^));
has error
W1057 Implicit string cast from 'ShortString' to 'string'

line
vtPChar : Result.Add(TJSONString.Create(PVarRec(@Args[I]).VPChar^));
has error
W1057 Implicit string cast from 'AnsiChar' to 'string'

line
vtAnsiString: Result.Add(TJSONString.Create(AnsiString(PVarRec(@Args[I]).VAnsiString)));
has error
W1057 Implicit string cast from 'AnsiString' to 'string'

and the code
class destructor TJSONDateManager.Destroy;
var
  I: Integer;
begin
  if Assigned(FFormats) then
  begin
    for I := 0 to FFormats.Count - 1 do
        FFormats[I]._Release;
    FFormats.Free;
  end;
end;


the line
FFormats[I]._Release;
has error
Not enough Actual Parameters.

If someone smarter than I could direct me on how to correct these wrapper
errors, I will be forever grateful.

Thanks,
Jim Sawyer


Eivind Bakkestuen wrote:
I tried the TextMagic delphi wrapper, and it had errors. I contacted
TeleMagic and they said it had not been updated for Delphi 10. They
suggested that I switch to Delphi XE7! That ain't hapening. Has
anyone got more and betterinformation on this situation?

If it works in XE7, changes to make it work in Tokyo would likely be
trivial. If you post more details about the errors, perhaps assistance
might get it working?

--
Eivind Bakkestuen [NDD]
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02