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)
“In some unused lagoon, some nameless bay,
On sluggish, lonesome waters, anchord near the shore,
An old, dismasted, gray and batterd ship, disabled, done,
After free voyages to all the seas of earth, hauld up at last and
hawserd tight,
Lies rusting, mouldering.”
—Walt Whitman (18191892)
“The conduct of God who disposes all things kindly, is to put religion into the mind by reason, and into the heart by grace. But to attempt to put it into the mind and heart by force and threats is not to put religion there, but terror.”
—Blaise Pascal (16231662)
“The sum and substance of female education in America, as in England, is training women to consider marriage as the sole object in life, and to pretend that they do not think so.”
—Harriet Martineau (18021876)