Reference object instance created using "with" in Delphi -
Is there a way to refer to the object instance created using "statement" with a "?"
Example:
Start with TAnObject.Create DoSomething (example); End; Where anything will use the context of the example as if you were going through an object object referencing variable for the object.
Example:
AnObject: = TAnObject.Create; Thanks.
OK, you can use this approach:
or class assistant:
type TOBjectHelper = class accessory toggle for private function GetThis: TOBject; In line; Public property: Read TOBject GetThis; End; ... TOBjectHelper.Get this function: TOBject; Start the result: = self; End; But, in fact, the last answer is correct: you should better remember the "with" statement.
Comments
Post a Comment