Home > Back-end >  Delphi test summary
Delphi test summary

Time:09-23

The difference between 1 TLIST and tobjectlist
Unlike TList, TObjectList Add, Remove, IndexOf, method such as Insert need to pass TObject object as a parameter, with the strong of compile-time type checking, make TObjectList than TList is more suitable for save the object, in addition have OwnsObjects TObjectList object attribute, when set to True (the default), with TList, TObjectList will destroy any object is removed from the list of objects, whether to invoke the Delete, Remove, Clear method, or release TObjectList object, will be destroyed in the list of objects, with TObjectList class, we don't have to use the loop to release the object, this avoids the release list object, due to forget to release the object in the list of memory leaks, in addition to pay attention to is OwnsObjects attribute will not affect the Extract method of behavior similar to TList TObjectList Extract methods, just Remove the object reference from the list, and will not destroy the object,

2. The list class and tlist class (object) is the difference between
Pre defined for the use of class of undefined class in front of the class list.

3. The inline property
In order to improve the performance of the application, you can use the inline statement, a function is a process for the declaration for the inline process, the compiler at compile time, will replace the normal way of procedure call, instead is directly get the function of the compiled code generation to invoke the process, there are several calls a function that is inserted directly in the calling function of compiled code, such abuses, generates larger EXE file,

4 overload overloaded
Phrase indicates an overloaded methods; For many of the same name in a class method with different parameter table situation; (property accessor methods cannot be overloaded);

5 the default action
Default instruction meaning is not the default value set properties, its meaning is: when you set the attribute values when the component visual design and it at the same time, the specified value is not only the value is stored in DFM file,

6 what abstract method using
Delphi abstract class defines only behavior in the class, it specifies the derived class must have certain behaviors, but the abstract class does not implement the behavior, and must by the derived class to implement these behaviors, so it is just a kind of "abstract" class, and we can't for the abstract class instance is created,

7. Stringlist usage scenario
Use a string list classes to store and operating a series of string

8. TObjectList=class (TList) Generic


9. TFileStream=class (THandleStream) usage scenario
The file open mode

10. The difference between the FORM and custform
Static class destructor Destroy; The purpose of the static constructor
The publish of usage;

Procedure WMPaint (var Message: TWMPaint); The message the WM_PAINT;
The message is said message processing method; Behind the keyword message indicated the method by the value of the response message; Message processing way to response to the news of the Windows, without having to invoke it directly;

TCustomFrameClass=class of TCustomFrame; The class of the usage of the
TCustomFrameClass=class of TCustomFrame;
TWinControl
The class constructor Create; Private
Rocedure Change; The dynamic; The difference between dynamic and virtual

CodePudding user response:

The top one,
  • Related