CASPER — Barack Obama told a cheering crowd at a town hall meeting in Casper today that he would restore respect for law in the White House by reviewing every executive order issued by President George W. Bush and discarding any deemed unconstitutional.

Obama’s comments came in response to a question from a man in the audience who said he worried that presidents sometimes consider themselves above the law.

Obama’s rival, Hillary Rodham Clinton is scheduled to speak in Casper this evening.

Both made appearances in the state in advance of Wyoming’s caucuses Saturday. The state will award 12 pledged delegates.

In his speech, Obama praised the libertarian spirit of Westerners — Republicans and Democrats alike — and condemned the Bush administration’s use of warrantless wiretaps and a willingness to hold prisoners without charges.

“There’s nothing Republican about that. Everyone should be outraged by that,” he said.

As president, he said he would ask his attorney general “to review every executive order” of the Bush administration. “We are going to overturn those that were unconstitutional. We are going to overturn those that are unnecessary.”

His answer drew a standing ovation from a mostly Democratic audience at the Casper Recreation Center.

In Wyoming, a Republican-dominated state and home of Vice President Dick Cheney, Obama promised to end the war in Iraq.

Iraq “was an unwise war,” he said, waged by Bush “with an assist from Sen. Hillary Clinton and Sen. John McCain,” his rivals for the presidency. “I will bring this war to an end in 2009.”

Obama made light of recent criticisms that he is untested and unready for the “3 a.m. call” informing the president of a national crisis.

“Watch out for this politics of fear,” he said. “What do people think I’m going to do? I’m going to answer the phone,” adding that he would not be browbeaten into an unnecessary war.

His answers did not please everyone. He told one fan of the space program that he does plan to cut some parts the NASA budget, partly to finance education programs.

“I grew up on Star Trek,” he said and believes in the future of the space program, but “NASA has lost focus and is no longer a source of inspiration.”

Obama also drew cheers and a standing ovation on a surprise subject: school tests.

He said he believes art and music are vital aspects of a public-school education. “I don”t want them to just learn to a test.”

Many of the people at the recreation center said they are still undecided in the presidential race, but they all agreed on one thing: It’s great to see presidential candidates in Wyoming.

“It’s pretty historic for someone to finally come to Wyoming. I had to come watch him,” said Tom Jones, a Casper resident who also plans to hear Hillary Rodham Clinton speak across town this evening. “JFK was here in Casper. That’s the last one,” he said.

Jones said has not decided how he will vote in November but would like to hear all three candidates in person.

Katy Cushing and her brother, Brian, also described themselves as on the fence.

She’s leaning toward Obama: “I don’t want to fall back to where we’ve been.”

He’s leaning toward Clinton: “Hillary’s more vetted when it comes to this kind of thing,” he said.

But on this they agreed: “We’re just really excited to get a chance to participate — not being overlooked as Democrats,” said Katy Cushing.

Chuck Lundgren drove almost 300 miles from Billings, Mont., to see Obama.

“I know too many young people that need health care,” he said. “I think Obama has the best plan of them all. He also has all the experience he needs to be president, despite what Hillary’s saying.”

Both Democratic candidates had two events in the state today.