The problem facing the biographer of Dashiell Hammett is this: What do you do with the last 25 years of his life, the years following his success and celebrity as the author of ''The Maltese Falcon'' and ''The Thin Man,'' the years when Hammett talked of writing, tried to write, but could not - the years of the blank page?
Diane Johnson, whose ''Dashiell Hammett: A Life'' is just out, says at the end of her introduction:
''Hammett . . . made himself an innovator and the master of a genre and developed techniques of fiction writing to go on with. He had glamour and money - more than he had ever imagined and as much as he wanted. But the heroism of his life lay not in his Horatio Alger success, rather it lay in the long years after success, when money and gifts were gone. It is the long blank years that prove the spirit.''
Johnson's strategy goes against the grain of previous writing about Hammett. Her book is noticeably different from the other recently published biography of Sam Spade's creator, ''Hammett: A Life at the Edge,'' by William Nolan, a longtime fan and scholar of Hammett.
Nolan's book begins in 1934 with Hammett near his peak, and Nolan spends the larger part of her book discussing the writing Hammett. His is a responsible, carefully researched book. It is certainly admiring, if not quite hagiographic.
Nolan supplies the facts with competence and authority. Johnson attempts to infuse those facts with greater inflection. Unlike Nolan, Johnson had the cooperation of Lillian Hellman - who met Hammett in 1930 and was, until his death in 1961, his lover and companion. Without her help, says Johnson, ''this book could not have been written.''
''Dashiell Hammett: A Life'' opens in 1951 with Hammett in prison. He is serving a six-month sentence for refusing to answer questions of the House Un-American Activities Committee about the Civil Rights Congress bail fund. As a trustee of the fund, Hammett lent his name and gave money to a variety of antifascist and communist causes. But the sad irony of his trial was, as Hellman said later in ''An Unfinished Woman,'' ''that Hammett had never been in the office of the Congress, and did not know the name of a single contributor.''
The book then proceeds chronologically and displays the familiar facts of Hammett's life. There are his years as a detective with Pinkerton, which led to the early writing for Black Mask, a mystery magazine. That led, in turn, to the five novels. These brought Hammett enormous celebrity and a life in the fast lane. That life went out of control. And that led finally to all those years of no writing at all.
Hammett did try to write. ''His discipline,'' says Johnson, ''was this: to sit down at the typewriter and put in his time. Unless he had a good excuse. He would try to contrive one: imperative good works, the service of his country or being dead drunk. But most days of life do not produce an excuse not to work, and usually he would sit down at his typewriter and wait.''
World War II provided a temporary refuge. In 1942, Hammett, age 48, enlisted in the Army. He spent the next few years in the Aleutian Islands, part of the time editing the Adakian, a newspaper for the 50,000 troops stationed there. The day he signed up, he said to Hellman, ''This is the happiest day of my life.''
The above is a surprising remark in light of Hammett's success. But perhaps he was one of those people who feared success more than he feared failure. Whatever, the contradictions of Hammett's life were many. And while often spoken of by Johnson, they are mostly as unresolved by the end as they are at the beginning.
Johnson does reproduce many of Hammett's letters and comments by others on Hammett. The most memorable comment is that of Nunnally Johnson's: ''His behavior could be accounted for only by the assumption that he had no expectation of being alive much beyond Thursday.'' The book also contains a scattering of photographs of Hammett over the years.
But the biography's pace is sometimes erratic. Johnson's prose voice slips occasionally and disruptively into Hammett-like passages. The continual refrains - he drank too much, he could not write - punctuate the volume roughly.
There is also the problem of great expectations. This is what many mystery fans - myself included - developed when told that Hellman would cooperate with Johnson on the biography.
I'm not sure what I expected, but I know it was something more than I received in ''Dashiell Hammett: A Life.'' That the book is sometimes more dramatic than candid may be due to the fact that Hellman is still alive.
All this aside, Johnson's is a competent book. She writes better than Nolan, yet neither author manages to sort out the contradictions of Hammett. Perhaps the story of Hammett is in the facts or maybe it is the realism of his life, not his fiction, that makes him so difficult to see.