Answer the question
In order to leave comments, you need to log in
In Pascal, ABC works, but in Delphi 7, an error occurs. How to fix?
function IsVowel(var ch:char):boolean;
const len = 10;
var
arr: array[1..10] of char = ('А', 'У', 'О', 'Ы', 'И', 'Е', 'Ё', 'Я', 'Ю', 'Э');
i: integer;
begin
IsVowel := false;
for i := 1 to len do
if arr[i] = ch THEN
IsVowel := true
end;
Answer the question
In order to leave comments, you need to log in
local variables cannot be immediately initialized (it is possible starting from Delphi 10.3 Rio (inline variables))
since array elements do not change, you can make a constant
PS but in general, yes, it's better to do as SagePtr advised
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question