here it unfortunately doesn't work as you hope. not very clear what you are trying to achieve. try to explain a bit more. and if you try to include a code in your post, follow
with this your code would come well formatted.
Let's see if I can do it.
I would like to fill the new table with the values assigned to "a" in the "for" statement, so if I say "for a=3 to 4" I should see the numbers 4 and 5 but in my table I see only the number 4, I can't fill the new table.
Thanks all for helping
[Numeri e Lettere.xls]
(biff, embedded labels, table is [Foglio1$]);
Numeri as Numbers,
Lettere as Letters
for a=3 to 4
let varmyNumber = peek('Numbers', $(a), '[NumberLetterTable]');
[Lista Numeri e Lettere]:
load '$(varmyNumber)' as myNumberCharacter
so you have done it !
what you are trying using PEEK - telling the position from where (which of the pre-loaded records) to be picked. if this is what you want (positioned based values to pick), your code is probably to the right direction. if you are trying the exact numeric values (3 and 4) to pick then Miguel's suggestion is to be followed (provided the values are there in loaded data). i find one more possibilty you could attempt to : you might try to generate those values your own, in that case you have to rewrite the code somewhat like :
Load $(a) as MyNumberChar
Probably PEEK would not be required.
Unless there is no other way to get what you want, I'd avoid the use of loops because of poor performance and ease of use of alternatives.
Anyway, the Peek() function takes in its three parameters version, both field and table name as literal (string). So changin your current line to this one (removing square brackets from [NumberLetterTable]) should return as expected:
peek('Numbers', $(a), 'NumberLetterTable');
Hope that helps.
Yours is a very valid point. may be my understanding was not exact, i suggested the solution assuming that the data (3,4) is not there in the loaded data(as i explained in my prev post too), so autogeneration(generate the data of your own) is the only option and loop is a consequent. Otherwise you are right.