The mandatory sentencing law has an escape clause: defendants who sell drugs to support narcotics addictions don't have to receive automatic prison terms, allowing judges to place them in drug treatment programs.

But the law doesn't spell out how judges should determine who is addicted, opening the door to all kinds of gambits as well as guesswork by defendants, their lawyers and even judges.

D.C. Superior Court judges have their own ideas on when drug use crosses the line from recreation to habitual abuse and they use widely varying methods of determining when a defendant is addicted to narcotics such as heroin or Dilaudid.

"Some judges are more likely to find that someone is an addict. Others are much more difficult to convince," said Kim Taylor, a lawyer for the D.C. Public Defender Service. "It makes it difficult. The only way for you to figure out what kind of a showing to make is to do a little research on the judge that you're before."

Some ask for records that show a defendant received previous drug treatment. Others want to know exactly how much and what a defendant ingests, how much he paid and whether he inhaled the substance or intravenously injected it. Some demand to see track marks.

But there are those who take a simpler approach.

"Sir, were you addicted at the time of the commission of these offenses?" Judge George W. Mitchell asked defendant Frank Ferguson after the government said it had no evidence to dispute a finding that Ferguson was an addict.

"Yes, sir," Ferguson responded.

"The court finds that he falls within the exception."

Judges routinely defer to psychiatric experts when deciding the mental competence of defendants. Such experts are rarely consulted in deciding whether a defendant is an addict -- even in borderline cases.

Court-appointed defense attorneys get reimbursed for expert witnesses, but judges said they have never seen a voucher for an expert called to testify about a defendant's drug addiction.

"That's an interesting question. I'm not even sure how an expert would recognize the addict," said defense attorney Leslie Holt. "I think it could be done. I assume it would be a very, very expensive system to put in place."

Holt said he doesn't see it as the role of a defense attorney to determine whether a client is an addict or not. "How do you know that any more than he's guilty or innocent? I tell them [clients] what the exception is, what it means to them and ask them if they fit the criteria. If they say, 'Yeah, I'm an addict,' you say, 'All right,' and you prepare them for the hearing."

Sometimes lives are changed in a matter of minutes when defendants who claim they are addicts don't understand the questions posed to them and perform poorly on the witness stand.

Judge Nicholas Nunzio in May 1984 sentenced a 19-year-old woman, one month pregnant and with a third grade education, to a mandatory term of four to 12 years after a hurriedly called addiction hearing in which both the defendant and her lawyer were not prepared.

"On Aug. 1, 1983, were you arrested for possession with intent to distribute heroin?" Erainer Nicks was asked by her attorney. "I don't know what that means," Nicks replied. At another point, Nicks was asked what drugs she was using and Nicks answered, "I was smoking chemicals." Later, though, Nicks told the judge, "I ain't never used drugs, your honor."

A larger problem for Nicks was that she claimed she was selling drugs to support a PCP habit. PCP is not a narcotic under the sentencing law. Neither is cocaine or Preludin, and users of these substances cannot claim the addicts' exemption..

"The first flaw with the statute is that it makes what appears to me to be a very artificial distinction between heroin, Dilaudid and all of the other substances that people use, like cocaine, for which I think there is plenty of evidence to support the view that that's an addictive substance," said Judge Steffen W. Graae. Graae's view is supported by other judges and lawyers, who feel that the exclusion unfairly prevents many people with severe drug problems from getting treatment. And the number of PCP and cocaine users is skyrocketing. In The Post's 1983 sample, nine arrests involved cocaine, compared with 25 in a 1985 sample. PCP was involved in 16 cases in a 1983 sample, compared with 51 in 1985.

While there is no medical consensus on whether cocaine and other non-narcotics are physically addictive, there is growing evidence that these drugs can lead to even greater psychological dependence than heroin and other opiates.

To Charles Williams, 23, cocaine was "the lady with the glass slipper." When he first started moving heroin to the street peddlers at 14th and W streets NW, the money he made went in the bank toward a condo. More and more though, it went for cocaine.

Sometimes, he said, he would sit for days in his room, skipping meals and spooning $100 bags of the white powder into his glass pipe, heating the brew over a propane flame and drawing the smoke into his lungs. "When it starts getting cloudy, then you've got a home run." He would become enraged when he had no money for cocaine and remembers times he threw things out windows. Williams is now at Lorton Reformatory's Occoquan Camp, serving four to 12 years for selling heroin.

Williams had sought a drug treatment exemption, unsuccessfully claiming he was a heroin addict.

Wesley McCray, 22, had been shot in the abdomen in the spring of 1983 and claimed he got hooked on cocaine to stop the pain. When he came to court a year later for sentencing on a charge of possession with intent to distribute PCP, his attorney, Penney Marshall of the Public Defender Service, told Judge Ronald P. Wertheim she thought the law was wrong to exclude her client from the treatment alternative.

Marshall said, "I imagine the voters that voted for it had no idea of what was specifically meant as narcotic substances," and Wertheim appeared sympathetic. "Well, if I could rewrite it [the sentencing law]," he said, "I'd probably rewrite it in a great number of methods." But Wertheim said he had to sentence McCray to a minimum of 20 months in prison.

McCray has asked the D.C. Court of Appeals to strike down the sentence on grounds that the law, by exempting only narcotics addicts, violates his constitutional right to equal protection. The U.S. attorney's office has told the court that the law's distinction between different kinds of drugs is "reasonable."

Some defendants -- those who go to trial and maintain their innocence -- find the law can be a trap. They have a legal right to take the witness stand and deny they were selling drugs. But once they do, they risk a perjury charge if they return to court for sentencing and say they were selling to feed a habit.

"Frankly, your honor, from a legal point of view, I wasn't aware. In fact, my awareness was that he could still plead to the fact he has an addiction," attorney Donald R. Gratehouse told the judge after a jury convicted his client of possession with intent to distribute heroin. The client, 30-year-old Norris Holley, a confirmed heroin addict, was sentenced to a mandatory four to 12 years.

And, in an admission that illustrates some of the ploys used at sentencing, Gratehouse now says he was merely "trying to slip it past" the judge.

"Some judges were unaware that you couldn't get the addict exemption if you went to trial and were convicted," he said. "I had already tried that once before and got away with it. So I thought I'd try it again."