Delphi7 (Day 1: writing classes)

Source: Internet
Author: User

All evil Delphi, writing too slow .....

Pascal, The begin .. End

I guess! There is no user-friendly design at all. I will go.

Day 1

Program project1; {$ apptype console} uses sysutils, unit1 in 'pas \ unit1.pa'; var P: person; begin P: = person. create; p. setname ('delphi author '); p. setage (0); p. setsex ('Abnormal '); p. speak; readln; end.
Write classes

Unit unit1; interfacetype person = class private name: string; age: integer; Sex: string; public procedure setname (Name: string); function getname: string; Procedure setage (age: integer); function getage: integer; Procedure setsex (sex: string); function getsex: string; Procedure speak; end; implementation procedure person. setname (Name: string); Begin self. name: = Name; end; function person. getname: string; begin result: = self. name; end; Procedure person. setage (age: integer); Begin self. age: = age; end; function person. getage: integer; begin result: = self. age; end; Procedure person. setsex (sex: string); Begin self. sex: = sex; end; function person. getsex: string; begin result: = self. sex; end; Procedure person. speak; begin writeln ('Fuck, really slow write'); end.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.