procedure TForm1.ListBox1Click(Sender: TObject); function ii(str:string):boolean; begin result:=false; if (pos('.',str)>0) or (pos('_',str)>0) then result:=true; end; begin if ii(self.ListBox1.Items[listbox1.ItemIndex]) then showmessage('存在.或者_'); end;
procedure TForm1.ListBox1Click(Sender: TObject); var i, j:integer; str: string; begin /// i:=listbox1.Items.Count ; i:=ListBox1.Items.Count-1; for i:=0 to i do if ListBox1.Selected[i] then begin str:=ListBox1.Items.Strings[i]; if pos('.',str)=0 or pos('-',str)=0 then showmessage('1'); end; end; end.
function ii(str:string):boolean;
begin
result:=false;
if (pos('.',str)>0) or (pos('_',str)>0) then
result:=true;
end;
begin
if ii(self.ListBox1.Items[listbox1.ItemIndex]) then
showmessage('存在.或者_');
end;
var
i, j:integer;
str: string;
begin
/// i:=listbox1.Items.Count ;
i:=ListBox1.Items.Count-1;
for i:=0 to i do
if ListBox1.Selected[i] then
begin
str:=ListBox1.Items.Strings[i];
if pos('.',str)=0 or pos('-',str)=0 then
showmessage('1');
end;
end;
end.