Complex sentence: By 1762 he was a major, and served in the campaign against the Spanish invasion of Portugal (1762).
Split into simpler sentences: By 1762 he was a major. Dalrymple served in the campaign against the Spanish invasion of Portugal (1762).