Electric and magnetic properties of CO, HF, HCI, and CH3F