Code:
So my problem is that it keeps on giving me 'constant expression exprected' error at the first 'end;' and I have no idea why , any help please
My project is as follows I'm trying to create an application of that when the user clicks the Process button the program must calculate and display the age of the entrant . This must be checked to see if they are eligible to enter the selected age group category. The program must indicate whether the entrant is allowed to participate according to his/her age.
Using the if , and case statement also Richedit , this is a school task . Any help would be appreciated
PHP Code:
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.BitBtn2Click(Sender: TObject);
var
sName , sYearOfBirth , sCurrentYear : string;
iCurrent , iBirth , iAge, iKids, iJuniors, iBigKids, iTeens, iSeniors, iCurrentAge : integer;
begin
sName := Edit1.Text ;
sYearOfBirth := Edit2.Text;
sCurrentYear := Edit3.Text ;
iBirth := StrToInt(sYearOfBirth);
iCurrent := StrToInt(sCurrentYear) ;
iCurrentAge := (iCurrent - iBirth);
RichEdit1.Lines.Add( ' Name of entrant is:' + sName) ;
RichEdit1.Lines.Add( ' Your age this year is ' + IntToStr(iCurrentAge) ) ;
case iAge of
3..5 : Inc(iKids);
6..8 : Inc(iJuniors);
9..10 : Inc(iBigKids);
13..16 : Inc(iTeens);
17..18 : Inc(iSeniors);
if iAge = iCurrentAge
then RichEdit1.Lines.Add(' You are eligble to enter this section ')
[font]end;[/font]
end;
end.
My project is as follows I'm trying to create an application of that when the user clicks the Process button the program must calculate and display the age of the entrant . This must be checked to see if they are eligible to enter the selected age group category. The program must indicate whether the entrant is allowed to participate according to his/her age.
Using the if , and case statement also Richedit , this is a school task . Any help would be appreciated
