[fpc-pascal] some new features to delphi prisem

Johann Glaser Johann.Glaser at gmx.at
Tue Feb 23 19:03:13 CET 2010


Hi!

Am Samstag, den 20.02.2010, 19:01 +0100 schrieb J├╝rgen Hestermann:
> 
> > y := case Other of
> >          bla : 'hello';
> >          foo : 'bye';
> >          baz : 'adius';
> >        end;
> 
> What do you gain with this?
> Doesn't look much different to
> 
> case Other of
>    bla : y := 'hello';
>    foo : y := 'bye';
>    baz : y := 'adius';
>    end;

You are looking at the wrong example! Clearly, for variable assignment
you don't gain anything. But for a function argument you do!

  WriteLn('The value is ',(if X then 'true' else 'false'),
          ' at the moment.');

and

  MakeBackup(FileName,ChangeExtension(FileName,
    case BackupExtension of
      exBak   : '.bak';
      exBkp   : '.bkp';
      exTilde : '~';
    else '.bak'
    End));

Bye
  Hansi





More information about the fpc-pascal mailing list