Ronen, you can not query the number of elements. If you exceed the number of elements there is an option to have the indexes wrap. E.g. If you query the 6th element of a datalinq with only 5 elements you'll get the first again.
In recent versions (5.4 and above) You can script datalinq keys to step through a datalinq. One approach would be to put a script event on the scene director that increments the value of the datalinq key and does a RefreshDatalinqs. You could then have a loop event on the scene director to keep looping and advancing the value.
Something like this:
dim keys as xpDatalinqKeys
dim key as xpDatalinqKey
if Scene.GetDatalinqKeys(keys) then
if keys.GetKeyByName("jersey", key) then
key.AsString = (CInt(key.AsString)+1).ToString
Scene.RefreshDatalinq
end if
end if
#XPression