[fpc-devel] Multiple variable initialization
ozznixon at gmail.com
Sat Mar 24 16:15:28 CET 2018
does not require type:
var a=0,b=0,c=0; // all are zero
// and if your presetting to zero due to Pascal not pre-initializing
var a,b,c; // all are zero
b are zero.
some Pascal Dialets do support
var a:=b:=c:=3; // all are 3
On Sat, Mar 24, 2018 at 10:59 AM Mattias Gaertner <nc-gaertnma at netcologne.de>
> On Sat, 24 Mar 2018 15:41:15 +0100 (CET)
> Michael Van Canneyt <michael at freepascal.org> wrote:
> > On Sat, 24 Mar 2018, Ondrej Pokorny wrote:
> > > Is there a reason why multiple variable initialization is forbidden?
> > >
> > > program Test;
> > > var
> > > A: Integer = 0; // allowed
> > > B, C: Integer = 0; // not allowed
> > I think this is confusing to read.
> > Are B and C both initialized, or only B ?
> The "integer" is applied to both. It would be inconsistent to apply the
> =0 only to C.
> Since when is JS a role model for Pascal?
> fpc-devel maillist - fpc-devel at lists.freepascal.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel