In pascal, a function must return a value. So, you´ll have to write for example: Function GetTextColor: integer; if you don´t want to return a value at all, you´ll have to declare it as a procedure: Procedure GetTextColor;