Home computickets Error: No default index property for type char

Error: No default index property for type char

Author

Date

Category

I can not understand what the problem is (the string is indicated)

var
 I: char;
 J: Integer;
 S: String;
 X: Boolean;
Begin.
 Writeln ('Enter the string:');
 readln (s);
 For i: = Char [33] to char [255] do {here writes: no default index property for char}
 Begin.
  x: = false;
  For J: = 1 to Length (S) DO
  Begin.
   IF i = S [j] then
   Begin.
    IF Not x Then
     Write (I, '-');
     Write (s [j], '');
     Flag: = True
   end;
   IF x then writeln;
  end;
 end;
end.

Answer 1

for i: = char (33) to char (255) do

or

for i: = chr (33) to chr (255) do

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions