Robert K. Cunningham, who spent 27 years in the Army, much of it as an infantry commander, is a man of action. He doesn't believe in studying something to death when the solution is staring you in the face.

To Cunningham, a Republican member of the Virginia General Assembly from Springfield, the way to attack the AIDS epidemic is to find out who is spreading it. And the way to do that is through testing.

So Cunningham sponsored legislation calling for the testing of every Virginian, aged 5 and older, for the human immunodeficiency virus (HIV), which causes acquired immune deficiency syndrome.

Although his measure was judged too broad and failed, it was only one of more than 40 bills introduced this year in the Virginia and Maryland legislatures by lawmakers desperately seeking solutions to the fatal disease.

Although many of the proposals generally are viewed as radical, ineffectual or both, and are headed for defeat, some have won broad-based support, including efforts to protect public safety workers from the virus and the establishment of a centralized reporting system.

More drastic measures have included a Maryland proposal that some victims be quarantined, and bills in both states that would make the willful transmission of the disease a crime.

The desire for action can be traced to statistics: Since the nation's first case of AIDS was diagnosed in 1981, 53,814 cases and 30,158 deaths had been reported in the United States as of last Monday, according to the federal Centers for Disease Control in Atlanta.

The District reported 1,015 cases and, as of Sept. 30, 557 deaths; Maryland, 961 cases and 581 deaths, and Virginia, 637 cases and 364 deaths.

Bills that are most likely to be approved in Virginia this year are proposals for comprehensive studies.

They would include many of the ideas suggested in some of the bills being rejected this year.

Among them are whether the states should carry out voluntary or mandatory testing for marriage licenses, insurance policies, admission to health care facilities, prison inmates or those convicted of prostitution, drug use and sex offenses.

Other ideas that may be studied in Virginia are whether there is a need or a way to trace sexual partners of persons who test positive; if there should be a schools admission policy for students who have tested positive; how to balance confidentiality of victims with prevention of exposure to others, and how to assess the Medicare eligibility of AIDS patients in hospitals, nursing homes and hospices.

A main concern in both states is protecting emergency services technicians, firefighters, police officers and rescue workers by giving them advance notice about transporting known AIDS patients, or follow-up information when the disease is discovered later.

For fear of violating patient confidence, hospitals now refuse to tell such workers they have been exposed.

Sgt. Jerry Wargo, a Prince George's County firefighter, testified in Annapolis last week that in 1986 he took part in the rescue of a young man who tried to kill himself by slashing his arms and chest.

Wargo, who had a cut on his hand at the time of the rescue, later learned that the man had been despondent over the end of a homosexual love affair and had "been going from man to man" since the end of the affair.

The hospital tested the man for AIDS, but refused to tell Wargo the results, Wargo said.

Wargo said he has been tested three times for AIDS since then -- all the tests were negative -- but said he still worries about whether he contracted the virus.

But Dr. Gillian vanBlerk, director of the Maryland health department's AIDS administration, said notification of emergency workers often would mean little, because patients who are in the incubation period can transmit the virus even though they would test negative.

Legislation likely to get favorable treatment in both states would mandate warnings to funeral home employees about persons who have died of AIDS or other infectious diseases.

The Virginia proposal was boosted by a report that a Florida undertaker who was the father of Bernard L. Henderson Jr., director of the state's health regulatory boards, died of hepatitis B contracted as the result of embalming a hepatitis victim.

There has been no move toward required testing in the District, but Health Commissioner Dr. Reed V. Tuckson has encouraged voluntary testing.

The District government considered, but declined, to follow New York City's experiment of distributing sterile syringes to intravenous drug users, fearing it would send a message that the government condones drug use. But it is sending workers into drug corridors to distribute vials of liquid bleach, which can be used to cleanse syringes and kill the AIDS virus.

Members of a Maryland gubernatorial task force on AIDS, composed primarily of health professionals, are concerned that some of the initiatives in the General Assembly are unrealistic solutions and that others will make AIDS patients social pariahs. The panel has urged the General Assembly to reject many of the bills.

In Virginia, Gov. Gerald L. Baliles said that "before modifying Virginia's approach to education and testing . . .it is both appropriate and well advised to look at all these bills in the context of a study."

One of the bills headed for passage in Richmond would put into law an executive order issued by Baliles last month that would allow physicians to report the names of infected persons to local health departments.

A similar bill is pending in Annapolis.

Dr. Christopher M.G. Buttery, Virginia's health commissioner, said the various proposals include "a lot of individual, innovative ideas," but that none of them alone meets "the total needs. We need a study to develop a package for Virginia."

Maryland Gov. William Donald Schaefer's staff agrees. "It really is not a legislative issue," said Linda Crawford, the governor's health adviser.

Some lawmakers are looking in vain for legal solutions to the AIDS problem, she said. "They are scared and they are reacting," Crawford said.

"Legislation must be based on rational policy, not on fear," said Virginia Del. Warren G. Stambaugh (D-Arlington), who opposed nearly all AIDS proposals in the General Assembly except those calling for studies.

Del. William Horne (D-Talbot), chairman of the Maryland House Judiciary Committee, said imposing criminal penalties for willful transmission of the disease would not be effective because there is no punishment worse than death, a fate AIDS patients already face.

The governor's council in Maryland came up with its own recommendations last fall, but most of them would have been politically difficult and were rejected by Schaefer.

Among them was the idea of legalizing sodomy, to ensure that authorities don't begin enforcing the prohibition now on the books, thereby driving homosexuals underground.

The Schaefer administration also refused to back a recommendation that health workers in Maryland be required to treat AIDS patients who come to them for help.

There have been publicized instances of emergency room physicians refusing to treat people they suspect might have AIDS.

Schaefer is supporting council recommendations to require the testing of sperm donors and requiring hospitals and medical laboratories to make monthly reports to the state health department on the number of people who test positive for AIDS.

Dr. Donald M. Poretz of Annandale, chairman of the AIDS Committee of the Medical Society of Virginia and chief of infectious disease treatment at Fairfax Hospital, said, "You can pass legislation for . . .testing, but gay men and IV drug users, the highest risk groups, won't be tested. They aren't going to show up."

He said he has treated about 150 AIDS patients in the last five years.

But another Virginia legislator who advocates widespread testing, Del. S. Vance Wilkins (R-Amherst), said the cost of testing, which many opponents cite, "is small compared to the liability of treating every case we don't prevent."

Wilkins noted that opponents of increasing the speed limit on rural interstate highways to 65 mph warned that the higher speed might result in 18 additional highway fatalities next year.

"A tremendous more number of lives are going to be taken by putting off everything for a study about AIDS," Wilkins said.