| John Johnson 2004-03-27, 12:21 am |
| Try the following:
procedure TfrmLooping.btnloopClick(Sender: TObject);
var
sString : String;
jIndex. iIndex : Integer;
begin
sString := edtStringInitial.Text;
iIndex := sedStartFirst.Value;
While iIndex <= sedEndFirst.Value do
begin
jIndex := sedStartSecond.Value;
While jIndex <= sedEndSecond.Value do
Begin
sString := sString + IntToStr(iIndex) + IntToStr(jIndex);
inc(jIndex);
end;
inc(iIndex);
end;
edtStringOutput.Text := sString;
end;
end
I hope this helps.
John Johnson
"Albert Truter" <alberttruter@webmail.co.za> wrote in message
news:rYOdnWFZX-f6b5zd4p2dnA@is.co.za...
> Hey all you Delphi Guru's, please help.
>
> I need to convert the following For loop to a nested while loop.
> I send programe with as attachment.
>
> Thanks
> Albert
> alberttruter@webmail.co.za
>
>
>
>
> procedure TfrmLooping.btnloopClick(Sender: TObject);
> var
> sString : String;
> jIndex. iIndex : Integer;
>
> begin
> sString := edtStringInitial.Text;
> for iIndex := sedStartFirst.Value to sedEndFirst.Value Do
> begin
> for jIndex := sedStartSecond.Value to sedEndSecond.Value Do
> Begin
> sString := sString + IntToStr(iIndex) + IntToStr(jIndex);
> end;
> end;
> edtStringOutput.Text := sString;
>
> end;
> end.
>
>
>
|