Business Directory
Trade Forum
Vision 2000
Delphi
Domain Rates
Search
Music
Opinion Award
About
FeedBack
Quit


Delphi Bug List

| Tips & Tricks | Bug List | Cool Delphi Sites |
| Connectivity | Delphi 2.0 Features | Internet |

Delphi Documentation Bugs

DELPHI.HLP
ControlAtPos requires client coordinates, not screen coordinates.
Compiler Error 202 missing.
Cursors Property example is incorrect.
MDIChildren example code causes GPF.
OnCreate event incorrectly lists order of events at object creation.
TFieldDefs.Add is missing REQUIRED parameter.
TFont.Height and TFont.Size reversed description of pixel and point size.
TListBox Properties popup is incomplete.


ControlAtPos requires client coordinates, not screen coordinates.

Description:
For the ControlAtPos method (Keyword: ControlAtPos), the documentation states that the Pos parameter is in screen coordinates.
Correction:
Coordinates passed in the Pos parameter should be in client coordinates of the control being used.

Compiler Error 202 missing.

Description:
Attempting to view help for Compiler Error 202: Property cannot be published results in a Topic Does Not Exist error message.
Correction:
More information can be found on publishing properties by searching the help for "published parts". The most likely cause of this error is attempting to publish a property with a type that Delphi does not know how to read and/or write to a stream. To stream the data for non-standard data types, override the component's DefineProperties method and register a property reader and writer routine. See the source of TStringList for an example of how this is done.

Cursors Property example is incorrect.

Description:
The example for the Curosors Property topic (Keyword: Cursors Property, choose Example link) incorrectly shows a LoadCursor API call with the Instance parameter being passed as 1.
Correction:
The Instance parameter should be the instance of the application. This value is stored in a global variable, hInstance, available from the System unit. The line should read:

  Screen.Cursors[crMyCursor] := LoadCursor(hInstance, 'NewCursor'); 

MDIChildren example code causes GPF.

Description:
The example for the MDIChildren Property topic claims that the following code will close all of the MDI children of Form1:

var
  I: Integer;
begin
  with Form1 do
    for I := 0 to MDIChildCount-1 do
      MDIChildren[I].Close;
end;

This code actually causes a GPF. The reason is that the MDIChildren list property is recalculated after children are closed and opened. So, if there were two MDI child windows and the first were closed in the first iteration of the above loop, in the second iteration there is only one window, and it is referenced as MDIChildren[0]. However, the loop will attempt to call MDIChildren[1].Close.

Correction:
The following code will correctly close all MDI child windows by looping down through the children instead of up:

var
  I: Integer;
begin
  with Form1 do
    for I := MDIChildCount-1 downto 0 do
      MDIChildren[I].Close;
end; 

OnCreate event incorrectly lists order of events at object creation.

Description:
The OnCreate Event topic lists the order of events that occur when an object is created as:
  1. OnActivate
  2. OnShow
  3. OnCreate
  4. OnPaint
Correction:
The actual order of events is:
  1. OnCreate
  2. OnShow
  3. OnActivate
  4. OnPaint

TFieldDefs.Add is missing REQUIRED parameter.

Description:
The Add method for the TFieldDefs object (Keyword: Add, choose Add Method for Field Definitions link) is missing a parameter.
Correction:
The declaration for the procedure should read:

procedure Add(const Name: string; DataType: TFieldType;
   Size: Word; Required: Boolean);

The Required parameter is described as:

"to assign (or not assign) a constraint to the field that is equivalent to the SQL constraint NOT NULL." -- Steve Koterski (koterski@borland.com)

For those of you like me who know little about SQL, this means that new records are required to contain a value in this field (i.e. it may not be "NULL").


TFont.Height and TFont.Size reversed description of pixel and point size.

Description:
The topics for TFont.Size and TFont.Height (Keyword: TFont, choose Size or Height link) seem to be reversed.
Correction:
The description of TFont.Size actually applies to TFont.Height, and TFont.Height applies to TFont.Size.

Also, the formula shown for calculating a TFont.Size (shown in the TFont.Height topic) will not compile because of the use of the / operator and storing the result to an integer variable. You can use the following line if you need to calculate the height in pixels of a font:


  PixelHeight := Trunc(-Font.Height * Font.PixelsPerInch / 72); 

TListBox Properties popup is incomplete.

Description:
The TListBox component topic has a popup topic, accessed through the Properties link. This popup topic lists all properties for the component and links to the appropriate topics explaining each property. Unfortunately, someone forgot to actually link each of the properties to the topics.
Correction:
You will have to use the search dialog of WinHelp for the particular property you need help with. For example, if you need help with the BorderStyle property, press the Search button and entery BorderStyle in the resulting dialog.  

| Borland Delphi | About the Authors | Home |

For Queries Mail To Webmaster

Copyright © 1996 Asylum Software Pvt. Ltd. This is an ASPL production.
Produced in conjunction with ASPL DELPHI TEAM.
Last revised November 27, 1996.