A generalization of McEliece's theorem on the p-adic valuation of Hamming weights of words in cyclic codes is proved in this paper by means of counting polynomial techniques introduced by Wilson along with a technique known as trace-averaging introduced here. The original theorem of McEliece concerned cyclic codes over prime fields. Delsarte and McEliece later extended this to Abelian codes over finite fields. Calderbank, Li, and Poonen extended McEliece's original theorem to cover cyclic codes over the rings /spl Zopf//sub 2//sup d/, Wilson strengthened their results and extended them to cyclic codes over /spl Zopf//sub p//sup d/, and Katz strengthened Wilson's results and extended them to Abelian codes over /spl Zopf//sub p//sup d/. It is...