<div dir="ltr"><div class="gmail_default" style="font-size:large">Actually (for clarity) JavaScript does allow multi-initialization, however, does not require type:<br><br></div><div class="gmail_default" style="font-size:large">var a=0,b=0,c=0; // all are zero<br></div><div class="gmail_default" style="font-size:large">// and if your presetting to zero due to Pascal not pre-initializing variables, javascript does, so:<br></div><div class="gmail_default" style="font-size:large">var a,b,c; // all are zero<br></div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">var a=b=c=1; // C and most JavaScript engines all three are 1<br></div><div class="gmail_default" style="font-size:large">var a,b,c=2; // in certain JavaScript engines only initializes C ==2, a and b are zero.<br></div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">some Pascal Dialets do support<br></div><div class="gmail_default" style="font-size:large">var a:=b:=c:=3; // all are 3<br><br></div><div class="gmail_default" style="font-size:large">Ozz<br></div><div class="gmail_default" style="font-size:large"><br></div></div><br><br><div class="gmail_quote"><div dir="ltr">On Sat, Mar 24, 2018 at 10:59 AM Mattias Gaertner <<a href="mailto:nc-gaertnma@netcologne.de">nc-gaertnma@netcologne.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, 24 Mar 2018 15:41:15 +0100 (CET)<br>
Michael Van Canneyt <<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>> wrote:<br>
<br>
> On Sat, 24 Mar 2018, Ondrej Pokorny wrote:<br>
><br>
> > Is there a reason why multiple variable initialization is forbidden?<br>
> ><br>
> > program Test;<br>
> > var<br>
> > A: Integer = 0; // allowed<br>
> > B, C: Integer = 0; // not allowed<br>
><br>
> I think this is confusing to read.<br>
> Are B and C both initialized, or only B ?<br>
<br>
The "integer" is applied to both. It would be inconsistent to apply the<br>
=0 only to C.<br>
<br>
<br>
> Javascript also does not allow this, I think, and for once with good reason.<br>
<br>
Since when is JS a role model for Pascal?<br>
<br>
Mattias<br>
_______________________________________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org" target="_blank">fpc-devel@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" rel="noreferrer" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a><br>
</blockquote></div>