Arggh, dontcha hate it when you post code and then see a typo? "Rev_Codes[counter];" should be "Rev_Array[counter];"
I think I almost got it now, It's returning this string:
250,,260,,270,272,,,,278,301,,,,,,,,,,,,,,,,,,,
I thought the i:=i+1 was only occurring after the "THEN clause, but it...