On Thursday 21 November 2013 10:36:27 Michael Schnell wrote:
> On 11/21/2013 10:06 AM, Martin Schreiber wrote:
> > that semantic is independent of order of items. With variable case
> > labels this is not possible.
>
> I don't understand what you mean by this. Could you give an example ?
>
"
 case i1 of
  1:
   res:= 10;
  2:
   res:= 20;
 end;

 case i1 of // same as above
  2:
   res:= 20;
  1:
   res:= 10;
 end;

 case i1 of
  1:
   res:= 10;
  1:
   res:= 20; //compiler error
 end;
"
"
 i1:= 1;
 i2:= 1;
 i3:= 1;
 case i1 of
  i2:
   res:= 10;
  i3:       //no compiler error
   res:= 20;
 end;

 case i1 of
  i3:       //no compiler error, different result
   res:= 20;
  i2:
   res:= 10;
 end;
"
[...]
>
> For me, the "case a of" syntax should be just an abbreviation of an
> "else if" cascade of
>
> if a=x1 then begin
>   ...
>   end else if a = x2 then begin
>   ...
>   end else if a = x2 then begin
>   ...
>   else begin
> end;
>
I don't think so. for me 'case' <> 'else if'.

Martin

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to