Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 12 of 12 total
Thread Procedure and while
Sun, May 11 2008 11:34 AMPermanent Link

Dieter Nagy
Roy,
DELPHI is not the problem, but SQL Smiley

Thanks for your help.

Dieter









Roy Lambert <roy.lambert@skynet.co.uk> wrote:

Dieter


I don't know without trying it if Tim's stuff will support nested while loops but I suspect it will. So all you should need is two loops - something
along the lines of

procedure TForm1.Button1Click(Sender: TObject);
var
a:integer;
b:integer;
begin
a:=1;
while a <= 45 do begin
b:=a+1;
while b <= 45 do begin
 memo1.lines.Add(inttostr(a)+' '+inttostr(b));
 inc(b);
end;
inc(a);
end;
end;

Which I think does what you're after

Until Tim comes up with his debugger its a good idea to try these sorts of things out in Delphi and then translate - at least its a language you're
more familiar with I hope Smiley

So the above would translate to something like

PREPARE stmt FROM 'INSERT INTO Zwei(Erste,Zweite) Values (?,?)';

SET ZAHL = 1;

WHILE ZAHL <=45 DO BEGIN
SET ZAHL1 = ZAHL + 1;
WHILE ZAHL1 <= 45 DO BEGIN
    EXECUTE stmt USING ZAHL,ZAHL1;
    SET ZAHL1 = ZAHL1 + 1;
END WHILE;
 SET ZAHL = ZAHL + 1;
END WHILE


Roy Lambert [Team Elevate]
Mon, May 12 2008 3:30 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Dieter

>DELPHI is not the problem, but SQL Smiley

For me to at present, that's why for something like this I'd get the approach right in Delphi and then convert to SPM.

Roy Lambert [Team Elevate]

« Previous PagePage 2 of 2
Jump to Page:  1 2
Image