我在delphi7下编的小程序,老是出问题?unitfourth
unfourth;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls;typeTForm1=class(TForm)Edit1:TEdit;Button1:TButton;Label1:TLabel;procedureButton1Click( );private{Privatedeclarations}public{Publicdeclarations}end;v
语法错误 在Delphi中的集合不是这么用的 要用[]括起来 代码改为 if var1 in [1,3,5,7,9] then label1.Caption:=inttostr(var1)+'是奇数' else if var1 in [0,2,4,6,8] then label1.Caption:=inttostr(var1)+'是偶数' else if var1 in [10..100] then label1.Caption:=inttostr(var1)+'是10到100之间的数' else label1.Caption:=inttostr(var1)+'是大于100的数 或者是负数' 在Delphi7.0中编译通过