This is what i think
You are trying to read 'yhgf' into an integer (gr_sk), so when read reads, it throws an error because 'yhgf' can't be transformed into an integer.
What should you do?
Well, I think that you can read it into a string, validate that it is a number, and then transform it into an integer. Frankly, I don't remember the Pascal way to do it. After googling around, found val procedure.
Val converts the integer or real number that is represented by the characters in the string Source and places it into x.