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 only free road, the Underground Railroad, is owned and managed by the Vigilant Committee. They have tunneled under the whole breadth of the land.”
—Henry David Thoreau (18171862)
“The sensitivity of men to small matters, and their indifference to great ones, indicates a strange inversion.”
—Blaise Pascal (16231662)
“I am using it [the word perceive] here in such a way that to say of an object that it is perceived does not entail saying that it exists in any sense at all. And this is a perfectly correct and familiar usage of the word.”
—A.J. (Alfred Jules)