At the age of thirteen he entered the University of Edinburgh.
In the summer of 1818, he resigned his mastership and, in order to increase the probability of obtaining a permanent appointment in the Church of Scotland, took up his residence in Edinburgh.