Thanks for your clarifications, they make sense. Finally got it to do what I wanted :D
item[int] test;
for x from 1 to 5
test[x]=to_item(x);
print("Map Reference:", "orange");
foreach it in test
print(test[it]+": "+to_int(test[it]), "blue");
print("");
sort test by -to_int(value)...