Lajos Juhász 293 Posted November 13 9 minutes ago, A.M. Hoornweg said: Static class methods are unable to access any members or methods that require a "self" parameter. As a result it can not be assigned to an event. Share this post Link to post
A.M. Hoornweg 144 Posted November 13 24 minutes ago, Lajos Juhász said: As a result it can not be assigned to an event. Exactly. Share this post Link to post
Remy Lebeau 1405 Posted November 13 10 hours ago, dummzeuch said: Alternatively one could create a plain procedure with the right signature, assign that to the code pointer of a TMethod record, leave the data pointer unassigned or set it to nil, and assign that record to the event using appropriate type casting. That's the way I usually do it when I need an event handler without an object instance. Share this post Link to post
mikerabat 20 Posted 19 hours ago On 10/27/2024 at 8:25 AM, Olli73 said: As local variable it is not initialized, as global it is. This not entirely correct - all basic types aren't. Strings, interfaces and dynamic arrays are initialized to nil. Share this post Link to post
JonRobertson 72 Posted 18 hours ago 52 minutes ago, mikerabat said: Strings, interfaces and dynamic arrays are initialized to nil. Often called managed types in Delphi code, because the compiler manages the lifetime of the heap memory used by those types. Share this post Link to post