Hello everyone, I am extremely confused and I have no idea how to fix this:

When I compile the program I get this message :Error:Incompatible Types:got "SHORTSTRING" expected "CHAR"
Here's the section of the program that's giving me issues:

IF selection=3 then
Begin
Writeln('Welcome to option 3');
Writeln('The winners for each event are as follows:');
FOR i:=1 to 39 do 
Begin
IF event[i]='100m' then  
Begin
event100m[i]:=timeran[i];   
Winner_100m:=timeran[i];   
Name_1[i]:=names[i];
School_1[i]:=school[i];
End;
End;                
FOR i:=1 to 8 do 
Begin
IF event100m[i]<Winner_100m then
Begin
Winner_100m:=event100m[i];  
K:=i; 
End;
End;
Writeln('Name: ',Name_1[K],' School: ',School_1[K],' Event: 100m',' Time Ran: ', Winner_100m:2:2);
var  names:array[1..39] OF string; 
     school:array[1..39] OF string;
     event:array[1..39] OF string;  
     timeran:array[1..39] OF real; 
     event100m:array[1..39] OF real;  
     event200m:array[1..39] OF real; 
     event400m:array[1..39] OF real;  
     event800m:array[1..39] OF real; 
     event1500m:array[1..39] OF real;
     selection,i,X,K:integer;  
     response:char; 
     Winner_100m,Winner_200m,Winner_400m,Winner_800m,Winner_1500m:real;         Name_1,Name2,Name4,Name8,Name15,School_1,School2,School4,School8,School15:string;

those event arrays store times for various events... thanks though, I was looking at it today and I found the problem, I set the name and school stuff as string and i should have used them as arrays

This article has been dead for over six months. Start a new discussion instead.