Subscribe Bookmark RSS Feed

Using Row and table operations in For loops

ajp

Community Trekker

Joined:

Jan 19, 2015

I am trying to label multiple rows in a sheet using a for loop, but for some reason the same code works on a single variable, but not inside the for loop.  Can anyone tell me what's wrong?  Thanks

Works:

alledc << selectwhere( Contains( alledc :EDC, stepID[1] ) & Contains ( alledc:Polarity, epi) );

alledc << label;

Doesn't Work:

for( i = 1, i <= N Items( stepID ), i++,

alledc << selectwhere( Contains( alledc :EDC, stepID[i] ) & Contains ( alledc:Polarity, epi) ),

alledc << label

);

1 REPLY
pmroz

Super User

Joined:

Jun 23, 2011

You need to convert that last comma to a semicolon:

For( i = 1, i <= N Items( stepID ), i++,

    alledc << selectwhere( Contains( alledc:EDC, stepID[i] ) & Contains( alledc:Polarity, epi ) );

    alledc << label;

);