Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This one is only getting the first record (aalfonso):
tblusers:
LOAD * INLINE [
Users
aalfonso
aantolini
];
FOR i = 0 to 1
LET arg = peek('Users',$(i));
TEST:
LOAD * INLINE
[
Test
$(arg)
];
NEXT
Hi,
Yes, both make sense. In the first case when using Peek() you are not specifying any table, so Peek() will return the last distinct value in the field 'Users', as you will see the values of the field in a listbox. Instead, this line will return as expected (two different values):
LET arg = Peek('Users', $(i), 'tblusers');
FieldValue() returns the value with that index number sorted by load order, regardless whether the value is or is not distinct or unique.
Hope that helps.
Miguel
But this one works:
tblusers:
LOAD * INLINE [
Users
aalfonso
aantolini
];
FOR i = 1 to 2
LET arg = fieldvalue('Users',$(i));
TEST:
LOAD * INLINE
[
Test
$(arg)
];
NEXT
Any idea?
Hi,
Yes, both make sense. In the first case when using Peek() you are not specifying any table, so Peek() will return the last distinct value in the field 'Users', as you will see the values of the field in a listbox. Instead, this line will return as expected (two different values):
LET arg = Peek('Users', $(i), 'tblusers');
FieldValue() returns the value with that index number sorted by load order, regardless whether the value is or is not distinct or unique.
Hope that helps.
Miguel
Thanks a lot!