

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
using loop FOR EACH ... NEXT
Hello all,
I need to join tables from active tables list. Please see the code below:
Table1=1;
Table2=1;
Table3=0;
IF Table1=1 THEN
NOCONCATENATE
TABLE1:
LOAD * INLINE
[
VAR1, VAR2, VAR3
A, 1, X
B, 2, X
];
ENDIF
IF Table2=1 THEN
NOCONCATENATE
TABLE2:
LOAD * INLINE
[
VAR1, VAR2, VAR4
C, 3, Y
D, 2, Z
];
ENDIF
IF Table3=1 THEN
NOCONCATENATE
TABLE3:
LOAD * INLINE
[
VAR1, VAR2, VAR3
E, 1, 0
F, 4, X
];
ENDIF
InTable:
LOAD IF(TableName=1,TableID) as Table
INLINE
[
TableName, TableID
$(Table1), TABLE1
$(Table2), TABLE2
$(Table3), TABLE3
];
FOR EACH vTable IN {"Need to take $(Table) from InTable"}
ActiveList:
LOAD VAR1,
VAR2
RESIDENT $(vTable);
DROP TABLE $(vTable);
NEXT vTable;
Thank's for any reply,
Justinas
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not understanding exactly what you are rying to accomplish, biut a suggeted syntax may be:
FOR i = 0 TO NoOfRows('InTable') - 1
LET vTable = peek('TableID', $(i), 'InTable')
LOAD VAR1,
VAR2
RESIDENT $(vTable);
DROP TABLE $(vTable);
NEXT i
-Rob

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Fabio,
I'm not sure if I got your mind or your solution is not, what I am looking for this time.
My issue is to use field value from the Inline table as a variable in a loop.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not understanding exactly what you are rying to accomplish, biut a suggeted syntax may be:
FOR i = 0 TO NoOfRows('InTable') - 1
LET vTable = peek('TableID', $(i), 'InTable')
LOAD VAR1,
VAR2
RESIDENT $(vTable);
DROP TABLE $(vTable);
NEXT i
-Rob


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It was just a peace of the big view, but you leaded me to the right direction. Thank's for your help, Rob.
