Recent

Author Topic: Constants declaration  (Read 7278 times)

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Constants declaration
« Reply #15 on: March 01, 2018, 02:28:21 am »
Is there particular reason why constants cannot be declared using ',' as a separator, eg

Code: [Select]
const A=1, B=2, C=3;


As far as I can see the '=' and ',' symbols can't be used as identifiers so that isn't the issue. I know I can use the following instead, but it just seems odd when variables can be declared with comma seperators.
Code: [Select]
const a=1; B=2; C=3;
const is a section directive not an attribute of the variable. A section has multiple declarations each declaration ends with a semicolumn ";" What is the logic behind the comma syntax?
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

TinyPortal © 2005-2018