通过pos在你的字符串里面查找~~“,”号作为分割符~~
然后把找到的数据与数据库里面的ID字段的内容进行比较~~如果存在~~
则选中~~也就是打一个“√”号~~
然后把找到的数据与数据库里面的ID字段的内容进行比较~~如果存在~~
则选中~~也就是打一个“√”号~~
解决方案 »
- 如何绘制图形且可选取
- delphi和sql进程之间的那些事!
- 注册公司,不知道大家能不能帮上忙?
- 这是一段关于timer的代码,请各位帮我解决一下。
- 请教各位,DELPHI中如何动态连接DB2
- 【十万火急:Dbexpress问题】 SQLStoredProc调用oracle *包*中存储过程的问题 报错找不到数据???
- 有没有无锡的公司招兼职程序员
- 请教:为什么专家分会少掉?
- delphi初学者请教高手有关窗体问题,以人格担保能解决问题者肯定给分!!!!
- 谁有编过MP3,RA,RM音乐程序?或知道有关此类的控件?
- 千山火线求援!居然被 TADOStoredProc 搞定,Up有分
- CSDN,你的安全令我伤心
有时候可能有好多的记录..我想能像dbgrid一样可以有滚动条来显示??
~~也就是另CheckListBox1.Checked[i] := True;
for example: (你再作一些其他处理)With arid do
begin
if Active then
begin
Filtered := false;
First;
While Not Eof do
begin
CheckListBox1.Items.Add(FieldByName('name').AsString);
CheckListBox1.Checked[CheckListBox1.Items.Count - 1] := True;
Next;
end;
end;
end;
(分割符在function中可设置)转换成TString,这样好操作。
procedure StringToStrings(S: string; const Strings: TStrings;
Delimiter: char = ',');
var
P: integer; //the pos that delimiter is in S
begin
with Strings do
begin
Clear;
P := Length(s);
while P>0 do
begin
P := Pos(Delimiter,S);
if P=0 then
begin //the last substring
Add(S);
Break;
end;
Add(Copy(S, 1, P-1));
S := Copy(S, P+1, Length(S));
end; //while
end; //with
end;