Delphi function Daquan, suitable for beginners