Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Would it be possible to use "for each" loop on a field of a table?
Like:
Let vfileList = Some_Kind_of_Function('fieldName'); //fieldName is a field of a table
for each vfile in $vfileList
Do something....
next
Thanks,
Josh
Use this code pattern:
For i = 0 To NoOfRows('tableName') - 1
Let vVal = Peek('fieldName', i, 'tableName');
// do something ....
Next
Edit - added the '-1'
Can you please explain the scenario?
Data:
Load Field1,
Field 2
From Table
let vFieldValueCount = FieldValueCount ('Field1');
For i=1 to $(vFieldValueCount)
let vFieldValue = FieldValue('Field1',$(i));
...
...
Next i
Hello,
Thanks for answer.
Sorry I forgot the mention he point.
I want to drop the table as soon as the field is set to a list variable.
Thanks,
Josh
OK, so add the line
Drop Table tablename;
What precisely do you mean by "list variable"?
Data:
Load Field1,
Field 2
From Table
let vFieldValueCount = FieldValueCount ('Field1');
For i=1 to $(vFieldValueCount)
let vFieldValue = FieldValue('Field1',$(i));
...
...
Next i
drop table Data;