A simple but efficient computational procedure is given for calculating either real or complex eigenvalues of wave equations. The method is based essentially on the 'outgoing-waves-only' criterion and enables one to use both short and long range potentials. The technique is illustrated by its application to scattering states of the square well potential.