We consider a model for O ordering in which any two O ions of the CuO(
x) planes repel each other with a screened Coulomb repulsion, but the
repulsion energy between two second-neighbor O ions with a Cu ion in b
etween is reduced by DELTAE, to account for the stabilization energy o
f perfect chains due to covalency and charge transfer. We calculate th
e screening length lambda using Thomas-Fermi theory, a slave-boson tre
atment of correlations and experimental data. For reasonable values of
DELTAE, the ground state of the model is consistent with most of the
observed diffraction data, with a possible explanation of photoinduced
effects for x approximately 0.4, and with recent calculations relatin
g T(c) with x.