Hi everyone.
Hi everyone.
While maintaning some old code I came across some weird use of an object.
It is something like this: pastebin.com/MbA7mnnc
I don't understand how is this possible. I was expecting an Access Violation exception or some kind of error. After all the object was not initialized.
Any clarifications will be welcome.
While maintaning some old code I came across some weird use of an object.
It is something like this: pastebin.com/MbA7mnnc
I don't understand how is this possible. I was expecting an Access Violation exception or some kind of error. After all the object was not initialized.
Any clarifications will be welcome.
Alexander Sviridenkov I always tought that for a method to be static I must have to use the class keyword, otherwise it will fail when called like that.
ReplyDeleteAttila Kovacs It is indeed the same question. Unfortunatelly I missed that post.
You're just returning a constant value. Try Result := ToString :)
ReplyDeleteGustavo Ribeiro Croscato there are 'normal' methods which has hidded instance parameter, class methods (declared with 'class') with hidden class parameter and class static methods with no hidden parameters (declared with 'class' and 'static').
ReplyDeleteNon-virtual normal methods can be called without creating object instance, if no object fields are used inside method.