条目是连续的导入没问题,要是选择的不是连续的就不对了(选择的是前几个(选择三个就是前三条)),谁能帮我改一改呢?代码如下
procedure Tf_main.sB_swyy2Click(Sender: TObject);
var
Iitemno,Ino,i: Integer;
ifsame:boolean;
begin
Iitemno:=0;
with sLB_swyyqb do
for Ino:=0 to Items.Count-1 do
begin
if Selected[Ino] then
begin
Iitemno:=Ino;
Break;
end;
end; ifsame:=false;
with sLB_swyyqb do
begin
for Ino:=Iitemno to Iitemno+(sLB_swyyqb.SelCount-1) do
begin
for i:=0 to sLB_swyyxz.Items.Count-1 do
begin
if Items[Ino]= sLB_swyyxz.Items[i] then
begin
ifsame:=true;
break;
end;
ifsame:=false;
end;
if ifsame=false then sLB_swyyxz.Items.Add(Items[Ino]);
end;
end;
end;
procedure Tf_main.sB_swyy2Click(Sender: TObject);
var
Iitemno,Ino,i: Integer;
ifsame:boolean;
begin
Iitemno:=0;
with sLB_swyyqb do
for Ino:=0 to Items.Count-1 do
begin
if Selected[Ino] then
begin
Iitemno:=Ino;
Break;
end;
end; ifsame:=false;
with sLB_swyyqb do
begin
for Ino:=Iitemno to Iitemno+(sLB_swyyqb.SelCount-1) do
begin
for i:=0 to sLB_swyyxz.Items.Count-1 do
begin
if Items[Ino]= sLB_swyyxz.Items[i] then
begin
ifsame:=true;
break;
end;
ifsame:=false;
end;
if ifsame=false then sLB_swyyxz.Items.Add(Items[Ino]);
end;
end;
end;
解决方案 »
- Currency转化成String后显示在Edit里丢失精度了?
- Combining signed and unsigned types - widened both operands
- 请关注如下几个问题
- 小问题,解决了即刻结帐
- 高分求救
- 初学者问题之三(只有十分了,不要嫌少)
- Delphi中要把一个字符串直接写到LPT1端口用哪个函数呢?
- 用来查询的query不能用来显示?
- 获取打印机的参数?
- delphi如何检测button是否被持续按下
- *** 高分请问一个比较难的问题,关于Delphi6和nvarchar的 ***
- 请教各派高手一个问题,DELPHI三层技术,怎么调用中间层,用TDCOMConnection起连接时Connected连不上,severname里面没东西啊
var
i: integer;
begin
for i:=0 to ListBox1.Count -1 do
begin
if ListBox1.Selected[i] then
begin
if ListBox2.Items.IndexOf(ListBox1.Items.Strings[i])<0 then
ListBox2.Items.Add(ListBox1.Items.Strings[i]);
end;
end;
end;