Soldier, civil servant and novelist; Born June 10, 1920; Died March 30, 2009.

I HAD the good fortune to have Jim Ford as a friend since we were at the Royal High and the University of Edinburgh. The 1939-45 war and our careers took us on separate courses, but I always came back to Edinburgh, and settled there again in 1980. There Jim was to be found, invariably welcoming, hospitable and stimulating in conversation.

Jim, who has died aged 88, and his brother, Douglas, were officers in the Royal Scots as part of the garrison of Hong Kong when it was attacked and captured by the Japanese in 1941. Jim displayed his formidable qualities and was awarded the MC. The citation spoke of "his untiring energy, courage and good leadership", and of his "action against the enemy after being wounded". Jim and his brother became prisoners of war under conditions of extreme hardship. His brother was killed.

Jim returned to Edinburgh and resumed a career in the civil service. He was in the Department of Agriculture in the Scottish Office from 1947-66, Registrar General of Scotland from 1966-99 and, until his retirement in 1980, principal establishment officer of the Scottish Office. Although never in robust health because of his time in captivity, he was highly regarded by his colleagues. He was awarded the CB in 1978.

Jim came to terms with his experiences by facing up to them and recording them in two novels, The Brave White Flag (1961) and Season of Escape (1963). He followed these with three more admirable novels about his subsequent and more agreeable life in Edinburgh, A Statue for a Public Place, A Judge of Men and The Mouth of Truth. He never fully recovered from the effects of his captivity. For an enthusiast for literature and an accomplished writer, the worst blow was the loss towards the end of his life of his ability to see well enough.

In retirement, Jim used his skills to improve the constitution and organisation of the Scottish Centre of International PEN, the worldwide association of writers. He was President of Scottish PEN from 1980-86 and one of the trustees of the National Library of Scotland. He was a keen member of he Royal Scots club. The Scottish Arts Club was another of his favourites.

Jim married Isobel Dunnett in 1948 and she and their son and daughter survive him By Paul Henderson Scott