Author Topic: Multiple CodeAlign  (Read 196 times)

LemonParty

  • Hero Member
  • *****
  • Posts: 651
Multiple CodeAlign
« on: August 07, 2026, 09:33:06 am »
Code: Pascal  [Select][+][-]
  1. const
  2.   {$CodeAlign ConstMin=16}
  3.   ArrA16: array [0..15] of Byte = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
  4.   {$CodeAlign ConstMin=32}
  5.   ArrA32: array [0..15] of Byte = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
Is it OK to use $CodeAlign multiple times in code if I want a different alignment?
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11

H₂SO₄

  • Sr. Member
  • ****
  • Posts: 492
Re: Multiple CodeAlign
« Reply #1 on: August 07, 2026, 09:41:13 am »
Yes - the docs say it's a local directive (can also be saved/restored using  {$push}/{$pop})

LemonParty

  • Hero Member
  • *****
  • Posts: 651
Re: Multiple CodeAlign
« Reply #2 on: August 07, 2026, 11:13:49 am »
Understood. Thank you.
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12993
  • FPC developer.
Re: Multiple CodeAlign
« Reply #3 on: August 07, 2026, 11:52:54 am »
(of course put it in actual code, since it is CODEalign, not data align)

 

TinyPortal © 2005-2018