5 Replies Latest reply: Feb 12, 2015 6:38 AM by Ruben Marin

# For - Next Loop

Hallo,

ich habe folgende Schleife

Testtable:

LOAD ApplyMap(......) as Land,

ApplyMap(...) as Wert

From xyz where ABC = '1';

SET v1 = 'A';

SET v2 = 'B';

für 1 = 1 to 2;

Table:

Resident Testtable where Land = '\$(v\$(i))';

let i = i + 1;

Next

dropt table Testtabelle;

Warum wird meine Table nur für die Variable v1 gefüllt?

Vielen Dank

• ###### Re: For - Next Loop

remove i = i+1

next will do that anyway

• ###### Re: For - Next Loop

This will work if you also change:

für 1 = 1 to 2;

to:

for i = 1 to 2 //<-- No semicolon (;) here

• ###### Re: For - Next Loop

true

but I believe this is actually pseudo code, just for demonstration purposes.

• ###### Re: For - Next Loop

Yep, I don't think QV lets you do "for 1=1 to 2"...already tested, it's undersigned red.

Anyway I can't undertand the final question so I don't really know what's the issue.

Most probably is only the i = i+1 you said.

• ###### Re: For - Next Loop

and please correct für 1 = 1 to 2; to for i = 1 to 2