If I understand correctly, you want both statements to be processed when the if statement is true.
In that case, you need the begin ... end around the statements to be processed when the if statement is true. Otherwise it will only process the first line if the statement is true and the second regardless. It sees the semi-colon as the end of the instruction, so it sees
if RadioGroup1.Items[RadioGroup1.ItemIndex] = 'Yes' then Edit1.Enabled:=false; as one command and
Edit2.Enabled:=true; as a separate command.
You need to use something like
if RadioGroup1.Items[RadioGroup1.ItemIndex] = 'Yes' then
begin[INDENT] Edit1.Enabled:=false;
Edit2.Enabled:=true;[/INDENT] end;
Hope that helps.
RoryGren
Junior Poster in Training
60 posts since Oct 2007
Reputation Points: 12
Solved Threads: 8
Yes, That should do it.
You might want to indent you code between the begin and end. It just makes it a bit more readable.
RoryGren
Junior Poster in Training
60 posts since Oct 2007
Reputation Points: 12
Solved Threads: 8