Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
can anyone explain me what happens when I use "do while ($(a) <= 3) " ?
When i use "do while ($(a) <= 3)" I get an endless loop.
With "do while (a <= 3) " it works right.
What´s the difference?
Example see below.
Table:
LOAD * INLINE [
Test1, Test2
1, 88
2, 77
3, 66
4, 55
9, 99
];
LET a = 1;
do while ($(a) <= 3)
LOAD
Test1,
Test2 AS NTEST2
RESIDENT Table;
LET a = a + 1;
loop
Thanks
hi,
the help function says the following about the do .. loop
"each condition is interpreted only the first time it is encountered but it is evaluated for every time time it [is] encountered in the loop."
You have used the $() expansion so that when the script encounters this line it interpretes it as
"do while(1<=3)"
it will then evaluate this same line again and again, hence your endless loop.
When you don't use $() expansions the script interpretes
"do wile (a<=3)"
this is succesfully evaluated at each loop.
I think that explains what you are seeing - use the debug fucbntion in the script editor to get a close look at what is happening as your script is stepped through.
hi,
the help function says the following about the do .. loop
"each condition is interpreted only the first time it is encountered but it is evaluated for every time time it [is] encountered in the loop."
You have used the $() expansion so that when the script encounters this line it interpretes it as
"do while(1<=3)"
it will then evaluate this same line again and again, hence your endless loop.
When you don't use $() expansions the script interpretes
"do wile (a<=3)"
this is succesfully evaluated at each loop.
I think that explains what you are seeing - use the debug fucbntion in the script editor to get a close look at what is happening as your script is stepped through.