function doequation(&p,eqn)