The two-dimensional time harmonic problem of diffraction through a slit is considered for arbitrary Dirichlet data, prescribed in the slit; on the screen itself the wavefield satisfies a homogeneous Neumann boundary condition. First of all, a sequence of special Dirichlet data is constructed, for each of these data the resulting wavefield can be expressed in closed form. The sequence can be constructed in a way which yields an orthonormal basis of Dirichlet data. After this has been done, arbitrary Dirichlet data can be expanded into a series of the orthonormal basis functions; this results in a representation for the searched wavefield. The presented method gives a deep insight into the mathematical structure of the problem.