Switching between porphyrin, porphodimethene and porphyrinogen using cyanide and fluoride ions mimicking volatile molecular memory and the 'NOR' logic gate.