Hi Ross,
The problem is that you started the 'if' with 'begin' so the compiler
expects an 'end' which you don't have!
The code should be:
if InputIsCDG then
begin
case WriteRadioGroup.itemindex of
0: BINbuffer := EmptyWAV;
1: BINbuffer := CDGbuffer;
2: BINbuffer := EmptyWAV+CDGbuffer;
end;
end
else
begin
case WriteRadioGroup.itemindex of
0: BINbuffer := copy(CDGbuffer,1,2352);
1: BINbuffer := copy(CDGbuffer,2353,96);
2: BINbuffer := CDGbuffer;
end;
end;
OR alternatively you can write (not using 'begin' & 'end' because the block
is already captured by the case statement):
if InputIsCDG then
case WriteRadioGroup.itemindex of
0: BINbuffer := EmptyWAV;
1: BINbuffer := CDGbuffer;
2: BINbuffer := EmptyWAV+CDGbuffer;
end
else
case WriteRadioGroup.itemindex of
0: BINbuffer := copy(CDGbuffer,1,2352);
1: BINbuffer := copy(CDGbuffer,2353,96);
2: BINbuffer := CDGbuffer;
end;
Cheers,
John
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Ross Levis
> Sent: Thursday, 28 June, 2001 15:53
> To: Multiple recipients of list delphi
> Subject: [DUG]: if case else
>
>
> Thanks all for the TimeSeparater help. OnCreateForm will do the trick.
>
> I have another beginners question. The following generates the compiler
> error ' ; not allowed before ELSE'. I can get around the problem but I
> don't think I should have to! Does it say somewhere that a Case
> statement can't be in a If..Begin..End block?
>
> if InputIsCDG then
> begin
> case WriteRadioGroup.itemindex of
> 0: BINbuffer := EmptyWAV;
> 1: BINbuffer := CDGbuffer;
> 2: BINbuffer := EmptyWAV+CDGbuffer;
> end;
> else
> case WriteRadioGroup.itemindex of
> 0: BINbuffer := copy(CDGbuffer,1,2352);
> 1: BINbuffer := copy(CDGbuffer,2353,96);
> 2: BINbuffer := CDGbuffer;
> end;
> end;
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"