An analytical theory of the resistive-wall instability of external kin
k modes in a tokamak allowing for toroidal effects is developed. It is
assumed that each mode is a set of a number of poloidal harmonics, on
e of which is the main harmonic while the others are side-band ones. I
t is allowed for that some of the side-band harmonics can possess sing
ular points inside the plasma. In describing the interaction of each o
f these types of harmonics with the remaining ones, the local and nonl
ocal ballooning effects are taken into account. In addition, the magne
tic well/hill related to each singular harmonic is allowed for. A set
of approximate (model) equations are derived, which allow for the sepa
rate study of the nonlocal ballooning effects and the local effects ty
pical for the Mercier modes (joint action of the magnetic well and loc
al ballooning effects). A general expression for the growth rate, whic
h consists of cylindrical and toroidal parts, is found. The cylindrica
l part of the growth rate for the case of a parabolic distribution of
the longitudinal current is calculated. The contribution to the toroid
al part of the,growth rate due to both nonsingular and singular side-b
and harmonics is obtained. It is shown that, in both cases, the side-b
and harmonics play a destabilizing role and make the instability more
sensitive to the value of the plasma pressure, as is observed in exper
iments. The case when the singular point of the main harmonic is suffi
ciently close to the plasma boundary is discussed. It is shown that, i
n this case, the instability can be sensitive to the presence of a mag
netic well and to the local ballooning effects related to this harmoni
c.