[BCB->Delphi]自定义类为何会在关闭程序时出错
下面这段代码编译正常通过,但是会出错,望前辈指点
implementation
{$R *.dfm}
Type
THuman = class {没有指定父类应该是从TObject派生吧}
public
Sex : Boolean;
Age:Integer;
Function Retire(IntAge:Integer):Boolean;
End;
Function THuman.Retire(IntAge:Integer):Boolean;
Begin
if IntAge >= 60 then
Result := true
else
Result := false;
End;
procedure TForm1.Button1Click(Sender: TObject);
Var
CurHuman1:THuman;
begin
CurHuman1.Create( );{关键位置,如果我不在这里使用Create程序编译完执行下一句的时候会出错,意思可能是没有初始化}
CurHuman1.Age := StrToInt(Edit1.Text);
if CurHuman1.Retire(CurHuman1.Age) then
Label2.Caption:='已经退休'
else
Label2.Caption:='正在工作';
CurHuman1.Free();{关键位置,这句我无论是注释掉还是让其运行,程序最后都会抛开异常, windows显示程序异常关闭}
end;
相关推荐
查询区号、身份证、手机归属地 (Delphi版本)
本站有BCB版本的由BCB-->Delphi版本的查询区号、身份证、手机归属地的,很方便的! 呵呵...相信有用得到的地方 !
EhLib 8.0 Build 8.0.023 Pro Edition FullSource for D7-XE8
EhLib 8.0 Build 8.0.023 Pro Edition FullSource for D7-XE8 亲测可用,含全部源码及 Demo The Library contains components and classes for Borland Delphi versions 7, 9, Developer Studio 2006, Delphi 2007, Embarcadero RAD Studio 2009-XE8, Lazarus. TABLE OF CONTENTS ----------------- Overview Installation Library Installation Help Demonstration Programs Registering and Prices Other information About author Where to start. ------------------- Read about EhLib for Lazarus in the file - Lazarus\readme.txt Start overview of the library with the main Demo project .\Demos\Bin\MainDemo.Exe. (Compiled Demo files are available in the Evaluation version of the library) Then you can read a summary of the new features and changes in the file history-eng.html. More detail about new features can be found in the file - About EhLib 8 Eng.doc To install a new version of the library in the IDE, use the installation program in .\Installer\EhLibInstaller.exe Overview -------- The Library contains several components and objects. TDBGridEh component TDBGridEh provides all functionality of TDBGrid and adds several new features as follows: Allows to select records, columns and rectangle areas. Special titles that can correspond to several/all columns. Footer that is able to show sum/count/other field values. Automatic column resizing to set grid width equal client width. Ability to change row and title height. Allows automatic broken of a single line long title and data row to a multiline. Title can act as button and, optionally show a sort marker. Automatically sortmarking. Ability to truncate long text with ellipsis. Lookup list can show several fields. Incremental search in lookup fields. Frozen columns. DateTime picker support for TDateField and TDateTimeField. Allows to show bitmaps from TImageList depending on field value. Allows to hide and track horizontal or vertical scrollbars. Allows to hide columns. Allows to show 3D fr
树莓派使用Openvino库进行车牌检测
开篇废话 百度找了半天官方介绍树莓派安装教程,结果发现找了半天都没找到,在这里先贴出官方安装Openvino的教程,并且,重要的事情要说三遍,三遍呀!!!血淋淋的教训:树莓派使用Openvino库需要先买一个英特尔的神经网络计算棒,这个搞得我重刷树莓派2遍,2遍呀!!!这都弄的我都怀疑人生了,我可是按照官方教程step by step呀 -
OpenVINO之三:Linux环境下OpenVINO安装与配置
OpenVINO系列: OpenVINO之一:OpenVINO概述 OpenVINO之二:OpenVINO之二:Windows环境下OpenVINO安装与配置
OpenVINO之二:Windows环境下OpenVINO安装与配置
OpenVINO系列导航: OpenVINO之一:OpenVINO概述 OpenVINO之二:安装与配置


语言基础/算法/系统设计
