delphi函数问题。请指教
lddcy 2003-08-29 11:38:16 unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, DBTables, Grids, DBGrids, StdCtrls;
type
TForm1 = class(TForm)
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
aa:array [1..15] of integer;
bb:array [1..1000]of set of 'A'..'O';
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i,j:integer;
s1,s2,k:string;
begin
for j:=1 to 1000 do begin
bb[j]:=[];
end;
i:=1;
table1.First;
while not table1.Eof do begin
s1:=table1.FieldByName('s').Text;
for j:=1 to length(s1) do begin
k:=copy(s1,j,1); // wrong here
include(bb[i],k);
end;
i:=i+1;
table1.Next;
end;
for i:=1 to 15 do begin
aa[j]:=0;
end;
for i:=1 to 1000 do begin
for j:=1 to 15 do begin
if chr(j+64) in bb[i] then aa[j]:=aa[j]+1;
end;
end;
end;
end.
当执行到include(bb[i],k);时出现类型不匹配错误,请问应该怎么修改