Copy the material

Hi there!

I can easily copy an object but I cant figure out how to copy its material too… Pls supply some short example code for that :eek:

Regards,