Recent

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

rpetges

  • Jr. Member
  • **
  • Posts: 96
    • 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: 5446
  • 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 »

rpetges

  • Jr. Member
  • **
  • Posts: 96
    • 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