Here is the full statement which has has been posted on his website.
"I am officially Very Poorly.
After a couple of surgical procedures, I am gradually recovering from jaundice caused by a blocked bile duct, but that - it turns out - is the least of my problems.
"I first thought something might be wrong when I developed a sore back in late January, but put this down to the fact I'd started writing at the beginning of the month and so was crouched over a keyboard all day. When it hadn't gone away by mid-February, I went to my GP, who spotted that I had jaundice. Blood tests, an ultrasound scan and then a CT scan revealed the full extent of the grisly truth by the start of March.
"I have cancer. It started in my gall bladder, has infected both lobes of my liver and probably also my pancreas and some lymph nodes, plus one tumour is massed around a group of major blood vessels in the same volume, effectively ruling out any chance of surgery to remove the tumours either in the short or long term.
"The bottom line, now, I'm afraid, is that as a late stage gall bladder cancer patient, I'm expected to live for 'several months' and it's extremely unlikely I'll live beyond a year. So it looks like my latest novel, The Quarry, will be my last.
"As a result, I've withdrawn from all planned public engagements and I've asked my partner Adele if she will do me the honour of becoming my widow (sorry - but we find ghoulish humour helps). By the time this goes out we'll be married and on a short honeymoon. We intend to spend however much quality time I have left seeing friends and relations and visiting places that have meant a lot to us. Meanwhile my heroic publishers are doing all they can to bring the publication date of my new novel forward by as much as four months, to give me a better chance of being around when it hits the shelves.
"There is a possibility that it might be worth undergoing a course of chemotherapy to extend the amount of time available. However that is still something we're balancing the pros and cons of, and anyway it is out of the question until my jaundice has further and significantly, reduced.
"Lastly, I'd like to add that from my GP onwards, the professionalism of the medics involved - and the speed with which the resources of the NHS in Scotland have been deployed - has been exemplary, and the standard of care deeply impressive. We're all just sorry the outcome hasn't been more cheerful.
"A website is being set up where friends, family and fans can leave messages for me and check on my progress. It should be up and running during this week and a link to it will be here on my official website as soon as it's ready."