This snippet will be better off using a hash table and store all the channels in its data, with a comma separating each of them. From experience I know a global variable can get cut off if the length reaches to a certain limit. I'm not sure, but the multiple target join on each network may vary...there may be a restriction on how many channels you can join together at a time.