TORONTO (Reuters) - Canada's main stock index edged up on Thursday to a three-week high, boosted by a bump in shares of Rogers Communications Inc (>> Rogers Communications Inc.) after it beat earnings expectations, while energy shares lost ground as oil prices fell.

Telecom and cable company Rogers rose 1.4 percent to C$64.88 after reporting better-than-expected quarterly profit on the back of strong growth in its wireless business that offset declines in cable.

Canadian Pacific Railway Ltd (>> Canadian Pacific Railway Limited) also gained on better-than-expected quarterly profit, which it reported late on Wednesday, although executives expressed concern about grain shipments for the second half of the year. The company's shares rose 0.5 percent to C$204.70.

Investors are assessing second-quarter earnings "to get an indication of whether the market can keep on an upward trajectory for the rest of the year," said Luciano Orengo, portfolio manager at Manulife Asset Management.

The Toronto Stock Exchange's S&P/TSX composite index <.GSPTSE> ended up 19.93 points, or 0.13 percent, at 15,264.64, its highest close since June 28.

Still, the index has dipped 0.2 percent for the year, lagging most other major markets, including the S&P 500 which has climbed 10.5 percent.

"To get the TSX out of this lull, you need energy to start contributing to returns," Orengo said.

Energy shares fell 0.8 percent as oil prices fell.

U.S. crude oil futures settled 0.7 percent lower at $46.79 a barrel as nagging worries about abundant global crude supplies weighed.

Shares of Hydro One Ltd (>> Hostopia.com Inc) overcame earlier losses to end up 0.6 percent at C$22.67. The electric utility said late on Wednesday it would buy rival Avista Corp for about C$6.7 billion to expand into the U.S. Northwest.

Seven of the index's 10 main groups ended higher.

Financials added 0.2 percent, helped by gains for some of the country's major banks. The materials group, which includes precious and base metals miners and fertilizer companies, also rose 0.2 percent.

Shares of BlackBerry Ltd (>> BlackBerry Ltd) dipped 0.1 percent to C$12.77 despite the company saying it had won the right to sell tools for encrypting phone calls and text messages to the U.S. government.

Exchange Income Corp (>> Exchange Income Corporation), a target of short seller Marc Cohodes, fell 8.2 percent to C$30.33 after reporting second-quarter earnings late on Wednesday.

(Additional reporting by Alastair Sharp; Editing by Bernadette Baum and James Dalgleish)

By Fergal Smith