Complex sentence: He did not lose hope of being appointed to an active post; but, when he was made an admiral in 1798, the rank was purely titular.
Split into simpler sentences: He did not lose hope of being appointed to an active post. In 1798 he was made an admiral, however the rank was purely titular.