For Programmers: Free Programming Magazines  


Home > Archive > Delphi > March 2004 > Hey all you Delphi Guru's, please help.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Hey all you Delphi Guru's, please help.
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.
>
>
>




Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com