Delphi 3.0 Bug List

Posted: (EET/GMT+2)

 

Delphi 3.0 Bug List

Here are some bugs I've found while using Delphi 3.0. I have submitted these bugs to the Delphi 3.0 Bug List maintained by Reinier Sterkenburg. You can find these bugs from there, and possibly elsewhere.

Currently 4 bugs are documented.

[ VCL | RTL | IDE | Compiler ]



Visual Component Library (VCL)


  • TField in Db.pas: If an OnGetText event handler is created, the handler may not be empty, which "violates" the Delphi component design principles.

    On page 22-8 of the Delphi 3 Developer's Guide, it is said: "An empty handler should produce the same result as no handler at all." However, this is not the case with TField's OnGetText event. Instead, if you create an OnGetText handler, you must make sure it returns something.

    The following code from the VCL source shows the problem:

      function TField.GetDisplayText: string;
      begin
        Result := '';
        if Assigned(FOnGetText) then
          FOnGetText(Self, Result, True) else
          GetText(Result, True);
      end;
      

    Here, according to the design principles, the code should call GetText method anyway, regardless whether an OnGetText event hanlder exists. This applies to the method "TField.GetEditText" also.

    Solution:

    Make sure field's OnGetText event handler always returns valid information.

    Note:

    The probably reason OnGetText handling mechanism has been defined as above is performance. However, this can be a difficult "bug" to track if you're customed to the fact that most event handlers can be empty.




Runtime Library (RTL)



Integrated Development Environment (IDE)


  • Problem with the "Search again" command in Search menu. The command doesn't remember the scope setting, which can be dangerous when used with the Replace All command.

    Problem example:

    • Make a selection in the editor
    • Open the Replace Text dialog box
    • Type something to replace and something to replace it with
    • Choose the Select Text Scope option
    • Uncheck the Prompt On Replace option, and click Replace All
  • The selection is simply searched, and everything replaceable is replaced with new text. If you now choose Search Again for example in another file, Delphi forgets the Scope option you just specified. Along with the Prompt On Replace option unchecked and Replace All button clicked, the results can be dangerous, as the scope suddenly is global, not selected text.

    Solution:

    Always invoke the Replace command from the Replace Text dialog box.


  • It is possible to select multiple units when using the "Use Unit" dialog box activated thru the File|Use Unit command, but even if multiple units are selected, only the most recent selection actually gets listed on the Uses clause of the unit.

    Solution:

    Only select one unit at a time.



Compiler


  • Not a bug but a feature both in Delphi 2 and 3 (maybe 1?). If a procedure or function is declared as a part of a class definition, the implementation can include a C-style "()" null-parameter parenthesis combination after the subroutine name.

    Code example:

      Type
        TMyObject = Class
          Procedure MyProc;
        End;
      
      Procedure TMyObject.MyProc();
      Begin
        ...
      End;
      

    Above, the compiler doesn't notice the additional open-close parenthesis combination after the procedure name. Such parenthesis aren't allowed in the Pascal language syntax if the procedure (or function) doesn't have any parameters.

    Note that this doesn't apply to "normal" subroutines. If "MyProc" wouldn't have been part of a class, the compiler would have shown a proper error message.

    Note:

    I haven't tested this with the old style "objects", ie. "Type TMyObject = object...".