Delphi and Free Pascal's Object Pascal
program ObjectPascalExample; type THelloWorld = class procedure Put; end; procedure THelloWorld.Put; begin Writeln('Hello, World!'); end; var HelloWorld: THelloWorld; { this is an implicit pointer } begin HelloWorld := THelloWorld.Create; { constructor returns a pointer to an object of type THelloWorld } HelloWorld.Put; HelloWorld.Free; { this line deallocates the THelloWorld object pointed to by HelloWorld } end.Note that the object construct is still available in Delphi and Free Pascal (Delphi-compatible mode).
Read more about this topic: Object Pascal, Sample "Hello World" Programs
Famous quotes containing the words delphi, free, pascal and/or object:
“At Delphi I prayed
to Apollo
that he maintain in me
the flame of the poem
and I drank of the brackish
spring there....”
—Denise Levertov (b. 1923)
“The brisk fond lackey to fetch and carry,
The true, sick-hearted slave,
Expect him not in the just city
And free land of the grave.”
—A.E. (Alfred Edward)
“Continuous eloquence wearies.... Grandeur must be abandoned to be appreciated. Continuity in everything is unpleasant. Cold is agreeable, that we may get warm.”
—Blaise Pascal (16231662)
“Agreeable then to my present inclination, I formed the object of my own worship, which was no other than my own understanding.”
—Sarah Fielding (17101768)