procedure TForm2.Button1Click(Sender: TObject);
var s:string;
i,count:integer;
begin
s:=edit1.Text;
count:=0;
for i:=1 to length(S) do
if Pos('111111', Edit1.Text) <> 0 then
label2.caption:='Yes: 111111!'
else
label2.caption:='No: 111111!';
end;

someone will be upshot use "while" OR "repeat..until"

No, no need for any loop in that code. Your code isnt going to do what I think you wanted it to.

The question and code don't relate:
my posted question is very difficult but I guess I'll just jump in and help where I can!
if Pos('11111',Edit.1Text)=0
then Label1.Caption:='No: 11111'
else Label1.Caption:='Yes: 11111';

No need for loop, while or repeat until

Which is what I said about 2 months ago.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.