Robert Warner Garland, a Hollywood screenwriter and producer who wrote “No Way Out” and “The Electric Horseman,” died on Saturday in Baltimore, Md., due to complications from dementia, according to his son. He was 83.

Garland was born on May 1, 1937, in Brooklyn, N.Y., and attended St. John’s College in Annapolis, Md. One of his first jobs in the industry was as a talent coordinator for “The Tonight Show Starring Johnny Carson” in 1969, and he soon became a writer and helped prepare Carson’s nightly monologues.

In addition to “The Tonight Show,” Garland also wrote for several sitcoms, such as “That Girl,” “The Bill Cosby Show,” “Love American Style,” “The Bob Newhart Show” and “Sanford and Son.”

In the film industry, he wrote the 1979 film “The Electric Horseman,” directed by Sidney Pollack and starring Robert Redford and Jane Fonda. The film was a box office success, earning $62 million from a $12.5 million budget and becoming the eleventh highest-grossing film of 1979. After working together on “The Electric Horseman,” Garland and Pollack had a close relationship and collaborated on “Tootsie,” though Garland was uncredited.

Garland wrote and produced “No Way Out,” directed by Roger Donaldson in 1987 and starring Kevin Costner, Gene Hackman and Sean Young. He also wrote “The Big Blue” by director Luc Besson and an early draft of “The Fifth Element,” also by Besson. Throughout his career, Garland was hired to write a large number of scripts that went unproduced, such as a sequel to the 1956 film “Giant,” and he was also uncredited on “Pretty Woman” starring Richard Gere and Julia Roberts.

Garland was a member of the Writers Guild of America. After living in Los Angeles and New York for work, he retired from screenwriting in the 1990s and lived in several places around the world, including Paris, France; Liguria, Italy; and Key West, Fla. He was admired for his encyclopedic knowledge of art and history, and he would often write scripts longhand or dictate them.

He is survived by his son Michael, an attorney in Washington, DC; his daughter-in-law Hedda Garland; and grandsons Jonah and Felix.