  Let us call a function $f$ from a space $X$ into a space $Y$ preserving if
the image of every compact subspace of $X$ is compact in $Y$ and the image of
every connected subspace of $X$ is connected in $Y$. By elementary theorems a
continuous function is always preserving. Evelyn R. McMillan proved in 1970
that if $X$ is Hausdorff, locally connected and Frechet, $Y$ is Hausdorff, then
the converse is also true: any preserving function $f:X\to Y$ is continuous.
The main result of this paper is that if $X$ is any product of connected
linearly ordered spaces (e.g. if $X = R^\kappa$) and $f:X \to Y$ is a
preserving function into a regular space $Y$, then $f$ is continuous.
