Recent

Author Topic: How to enable {$BOOLEVAL ON} for all source files  (Read 279 times)

Romain

  • New Member
  • *
  • Posts: 42
    • Attribute Changer Website
How to enable {$BOOLEVAL ON} for all source files
« on: August 03, 2020, 09:39:32 pm »
Hi,

I need to activate full boolean evaluation for all my project files. I can add  {$BOOLEVAL ON} into each single project file, but how can I add the difective in Lazarus so it gets used for all files ?

Many thanks.
Romain

PascalDragon

  • Hero Member
  • *****
  • Posts: 2093
  • Compiler Developer
Re: How to enable {$BOOLEVAL ON} for all source files
« Reply #1 on: August 03, 2020, 09:59:50 pm »
Boolean evaluation can only be changed with the compiler directive, thus you need to use it in each file or put it into an include file and include that in each file.

Please note that with $BOOLEVAL ON code like the following will trigger an exception depending on the input values (in this case if SomeObj is Nil):

Code: Pascal  [Select][+][-]
  1. if Assigned(SomeObj) and SomeObj.CheckSomething then
« Last Edit: August 04, 2020, 09:14:01 am by PascalDragon »

Romain

  • New Member
  • *
  • Posts: 42
    • Attribute Changer Website
Re: How to enable {$BOOLEVAL ON} for all source files
« Reply #2 on: August 03, 2020, 11:48:55 pm »
Many thanks for the information.

 

TinyPortal © 2005-2018