It is possible the mesh cannot be loaded.
Try:
If mesh is zero, there was a problem loading it.
Are you sure the mesh is in the same folder ? You could try checking the FileType() before loading it. If it returns a one, the file exists, else it returns zero.
Print FileType("mesh.x")
Try:
Graphics3D 640,480 mesh=LoadMesh ("mesh.x") print mesh
If mesh is zero, there was a problem loading it.
Are you sure the mesh is in the same folder ? You could try checking the FileType() before loading it. If it returns a one, the file exists, else it returns zero.
Print FileType("mesh.x")