Forum Discussion

Evgeny1's avatar
Evgeny1
New Contributor
7 years ago
Solved

Translated the program from Delphi 7 to Delphi Berlin

Hi All,

 

Our team translated the program from Delphi 7 to Delphi Berlin. After that, some of the functions in the TestComplete that worked on Delphi 7 now do not work. There is a function that searches for a column in the grid, and then remembers the value of the field in that column.

  • function GetGridVal_alt(mgrid: OleVariant; colname: WideString): WideString;
      var
      FldName: string;
      i: integer;
      GridView, a: OleVariant;
    begin
    //для DevExpress
      if mgrid.WndClass = 'TcxGrid' then 
      begin
        GridView:= mgrid.Views[0];
        for i := 0 to GridView.ColumnCount-1 do
        // Check the column caption
        if GridView.Columns[i].Caption = colname then
        begin
          FldName:= GridView.Columns[i].DataBinding.FilterFieldName;
          
          Result:=GridView.Columns[i].DataBinding.DataController.DataSet.FieldByName(FldName).AsString;
          Exit; 
        end;   
      end;
      end;
    The required column is found by the function. But at the output of the value it stops with an error. This derivation of the value from the grid corresponds to this line: 
    Result:=GridView.Columns[i].DataBinding.DataController.DataSet.FieldByName(FldName).AsString;
    We need to rewrite it somehow, that she would work for Delphi Berlin. Help me please.

5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    The current version of TestComplete is 12.31.  That version supports the following fully:

    Borland Delphi 7.0, Delphi 2005 and 2006, CodeGear Delphi 2007 and 2009, Embarcadero Delphi 2010, XE – XE8, 10, 10.1 (Update 1 and Update 2) (https://support.smartbear.com/testcomplete/docs/general-info/supported-technologies/development-tools.html).

     

    From my understanding. Delphi 10.1 is the Berlin version so TestComplete 12.31 SHOULD support that.  So, the question is, what version of TestComplete are you using?

     

    EDIT: The Berlin support was added in 12.30 so you need to be running at least that version to fully support applications developed in Berlin.

     

    • Evgeny1's avatar
      Evgeny1
      New Contributor

      Version TestComplete 12.31. Our program is configured in accordance with the instructions on TestComplete. How it seems to me a problem in the FieldByName method. Finding values in the grid works fine. The problem is only in the output of the values.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        What is the error you're getting in the indicated line?