delphi函数问题。请指教

lddcy lddcy 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
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);时出现类型不匹配错误,请问应该怎么修改
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
lddcy
Delphi 5,944 成员 262,941 内容