Pascal basic functions and explanation