Jump to content

Ian Branch

Members
  • Content Count

    1434
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Ian Branch


  1. D12.3, latest Git release of Rapid Generics 2, 64-bit testing using RapidGenericsTestSuite:

    [dcc64 Error] uListTest.pas(2225): E2532 Couldn't infer generic type argument from different argument types for method 'AreEqual'

     

     

    • Like 1

  2. No.  The calling form creates it just before setting the parameters.

    Here is the calling form's code:

    procedure TStatsForm.edtTotalInClick(Sender: TObject);
    begin
      //
      if edtTotalIn.AsInteger = 0 then Exit;
      //
      var sStartDate := FormatDateTime('yyyy-mm-dd', edtStartDate.AsDate);
      var sFinishDate := FormatDateTime('yyyy-mm-dd', edtFinishDate.AsDate);
      var sJobType := Trim(edtJobType.Text);
      if sJobType.IsEmpty then sJobType := '%';
      var StatsGridForm := TStatsGridForm.create(nil);
      //
      StatsGridForm.sFileName := 'JTsInRaised';
      StatsGridForm.sTitle := 'Job Tickets In/Raised..';
      StatsGridForm.sQuery := Format('''
                    Select JobNo, CustomerRef, Manufacturer, Model, AccountCode, JobType, JobStatus, DateIn,
                    DateRepaired, DateOut, DateInvoiced, Hours, RepairCode, Deposit, Charge from JobTickets
                    where BusCode = %s  and DateIn Between date %s and date %s and jobType Like %s
                    ''',[QuotedStr(AUD.BusCode), QuotedStr(sStartDate), QuotedStr(sFinishDate), QuotedStr(sJobType)]);
      StatsGridForm.iQty := edtTotalIn.AsInteger;
      //
      try
        StatsGridForm.ShowModal;
      finally
        StatsGridForm.Free;
      end;
      //
    end;

    StatsGridForm being the sub form.


  3. Hi Team,

    I may have beem wrong from the beginning but...

    In a calling form I have created a Sub Form then set some parameters for the form.

    In the sub form I had this:

      private
        const
          iWidth = 865;
        var
          { Private Declarations }
          FiQty: Integer;
          FsFileName: string;
          FsQuery: string;
          FsTitle: string;
      public
        { Public Declarations }
        property iQty: Integer read FiQty write FiQty;
        property sFileName: string read FsFileName write FsFileName;
        property sQuery: string read FsQuery write FsQuery;
        property sTitle: string read FsTitle write FsTitle;
      end;

    In the form's type.

    I then had this in the Form Create:

    procedure TStatsGridForm.FormCreate(Sender: TObject);
    begin
      //
      Caption := sTitle + ' - Total records..' + IntToStr(iQty);
      JobTickets.SessionName := dmC.DBC1.SessionName;
      JobTickets.SQL.Clear;
      JobTickets.SQL.Add(sQuery);
      JobTickets.Prepare;
      JobTickets.Open;
      //
    ....
    ....

    D12.3 doesn't seem to like this as it says that there is no SQL Query when being created. But it's been working for years.

    Any way, I moved the code to OnShOw and it is now happy and working:

    procedure TStatsGridForm.FormShow(Sender: TObject);
    begin
      //
      Caption := sTitle + ' - Total records..' + IntToStr(iQty);
      //
      JobTickets.SQL.Clear;
      JobTickets.SQL.Add(sQuery);
      JobTickets.Prepare;
      JobTickets.Open;
      //
    end

    So, to the question.  Was the original way allways wrong and I was just lucky, or, has there been a change??

    I use this technique in several areas so I may need to re-visit them all.. 😞

     

    Ian


  4. 3 minutes ago, PeaShooter_OMO said:

    You can also log the value of FY when the issue occurs.

    I have done this as a starting point.  I will have to wait for the Customer to have/experience the issue so I get the Error Report & Log.


  5. 32 minutes ago, DelphiUdIT said:

    As workaround try to define FY as INT64.

    Hmm.  I see where you are coming from but there multiple cases sof LongInt variables in multiple Units that will need to be changed.

    I will give it some thought.

    Hmmm.  If I going that far, perhaps I could use NativeInt...


  6. 16 minutes ago, David Heffernan said:

    Seeing this removed all my interest in helping. You don't have a clue what you are doing so blame Microsoft rather than yourself. 

    A little rude but...There was no blame assigned to anywhere except myself for not understanding.

    • Like 2

  7. Hi Team,

    D12.3, 64-bit App.

    An Application is reporting this issue:   

    Range check error at (0000000001B5E842{DBiWorkflow.exe}) [00000000027FE842] ad3WinAPIParser.TWinAPIControlParser.GetSelectionScreenPosition (Line 510, "ad3WinAPIParser.pas") + $44.

    Line 510 is:  NextLinePos := SendMessage(FHandle, EM_LINEINDEX, FY + 1, 0);

    FY is a LongInt.

    The PC it is being generated on is a Windows 10 64-bit PC.  Screen resolution is 1600 x 900.

    I have had a look at m$oft's EM_LINEINDEX but I am non the wiser.

    It doesn't happen all the time.

    Any thoughts/suggestions appreciated.

     

    Regards & TIA,

    Ian


  8. Hi Uwe,

    I tend to leave the method there in its original place but commented out so that if the test replacement method doesn't work out it is a 'simple' matter to delete the new and uncomment the old.

    The annoyance being selecting the entire method for some action.

×