the code that Adjazz showed to you is for making a .material file, when you have the .material file, then go to object maker and put the material name to the selected mesh.
If you want to know more, in the .object file you will find some code like this:
[groupname]
mesh0=BasicCube.mesh;0 0 0;1 1 1;1 0 0 0;
if you want to change the material of a object directly editing the .object file is hard because you need to know the nunber of sub-meshes of each mesh, in the case of a basic cube is 1.
you can change the material doing this:
[groupname]
mesh0=BasicCube.mesh;0 0 0;1 1 1;1 0 0 0;(insertname)Mat
is better if you use the object maker.