
If (s.x=1) or (s.x=100) or (s.y=1) or (s. You've receive several correct answers (the Ord function), but you may need to go beyond that: if you're converting the characters '0' through '9' to their numeric equivalents (0 through 9), you need to do more. The language construct ord(someVariable) evaluates to the index of any ordinal type, including, but not limited to any integer type and sub-ranges thereof, char, boolean, or any enumerative type. I don't know much about that exit code, could you explain me the problems of the programme? This is the longest program I have ever made with Pascal. Historical note: Originally, Pascal did not have typecasts and chr was a necessary function in order to do. Doing 7-1 to get the count won't work because you are excluding the first. Chr returns the character which has ASCII value X. EDIT: This is not due to the zero based, is a mathematic's thing: If you have let's say 7 elements and are 1 based order (from 1 to 7). With the arrival of typecasting a generic approach became possible, making ord mostly obsolete. Ord(Low(TComponentStyle)) 0 Ord(High(TComponentStyle)) 3 High(TComponentStyle) + 1 will return the the TComponentStyle's count.

Historical note: Originally, Pascal did not have typecasts and ord was a necessary function in order to do certain operations on non-integer ordinal types.
#Free pascal ord code#
I have tried to make a simple snake game with Free Pascal, when I started the programme, it drew the map exactly what I want but after that, I pressed the button that I have set to control the snake and it exited with exit code 201. Description Ord returns the Ordinal value of a ordinal-type variable X.
