how to disable directive lazarus / 31-LCL ---------------------------------------------------------------------- helio · 2018-04-19 15:35 how to disable {$IFNDEF VerboseAnchorSide} ? ---------------------------------------------------------------------- molly · 2018-04-19 16:09 What an odd question. Really ... it puzzles me. If you wish for that statement to be ignored then just put two slashes in front of it or change it into: Code: [Select]{.$IFNDEF VerboseAnchorSide} note the dot in front of $ Don't forget to to the same for the matching {$ENDIF} Oh, and recompile your LCL (as i'm guessing that is what you refer to). Seems like someone made a mistake using ndef, as it doesn't make much sense this way. But what do i know ---------------------------------------------------------------------- metis · 2018-04-19 16:34 @helio molly left out the most aggressive Way to meet this Challenge: Delete the Line, and don't forget to do the same with the matching {$ENDIF}. ---------------------------------------------------------------------- taazz · 2018-04-19 16:49 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$IFDEF VerboseAnchorSide}{$UNDEFINE VerboseAnchorSide}{$ENDIF} ---------------------------------------------------------------------- helio · 2018-04-19 17:28 wanted to disable it without having to change the lcl. through my application!!! ---------------------------------------------------------------------- marcov · 2018-04-19 17:29 For the case where this is not true, define an extra define ReallyNotDefinedVerboseAnchorSide and change to {$if not defined(VerboseAnchorSide) and defined(ReallyNotDefinedVerboseAnchorSide)} ... {$ifend} ---------------------------------------------------------------------- taazz · 2018-04-21 08:15 Quote from: helio on April 19, 2018, 07:28:08 pmwanted to disable it without having to change the lcl. through my application!!! sorry defines are unit bound can not be defined or changed outside the unit. ---------------------------------------------------------------------- Thaddy · 2018-04-21 09:18 Quote from: taazz on April 21, 2018, 10:15:32 amQuote from: helio on April 19, 2018, 07:28:08 pmwanted to disable it without having to change the lcl. through my application!!! sorry defines are unit bound can not be defined or changed outside the unit. That is not  entirely correct. You can disable a define globally from the command line (using -u) and you can also enable it globally (using -d) In Lazarus you can use these commands in your project settings. Note this ony works for -ALL- units, NOT the main program. Defines in the main program override the command line instead. Small demo: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit definetest;interface{$define test}implementationinitialization  {$ifdef test}  writeln('test is defined');  {$else}  writeln('test is not defined');  {$endif}end.Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program testdefines;{$ifdef fpc}{$mode delphi}{$H+}{$endif}uses definetest;beginend.Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i pi@raspberrypi:~ $ fpc -utest testdefines.pasFree Pascal Compiler version 3.1.1-r38795 [2018/04/20] for armCopyright (c) 1993-2018 by Florian Klaempfl and othersTarget OS: Linux for ARMHFCompiling testdefines.pasLinking testdefines10 lines compiled, 0.8 secpi@raspberrypi:~ $ ./testdefinestest is not definedCode: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i pi@raspberrypi:~ $ fpc testdefines.pasFree Pascal Compiler version 3.1.1-r38795 [2018/04/20] for armCopyright (c) 1993-2018 by Florian Klaempfl and othersTarget OS: Linux for ARMHFCompiling testdefines.pasLinking testdefines6 lines compiled, 0.8 secpi@raspberrypi:~ $ ./testdefinestest is defined ---------------------------------------------------------------------- Thaddy · 2018-04-21 11:05 All this means of course that -uVerboseAnchorSide and -dVerboseAnchorSide will work from the command line.  Or Lazarus project settings for the compiler. ---------------------------------------------------------------------- taazz · 2018-04-21 12:56 Quote from: Thaddy on April 21, 2018, 11:18:36 amQuote from: taazz on April 21, 2018, 10:15:32 amQuote from: helio on April 19, 2018, 07:28:08 pmwanted to disable it without having to change the lcl. through my application!!! sorry defines are unit bound can not be defined or changed outside the unit. That is not  entirely correct. You can disable a define globally from the command line (using -u) and you can also enable it globally (using -d) In Lazarus you can use these commands in your project settings. ahh, good to know there is such a construct, now how I make sure it does not work in my units? Quote from: Thaddy on April 21, 2018, 11:18:36 amNote this ony works for -ALL- units, NOT the main program. Defines in the main program override the command line instead. well as long as the define is explit inside the unit then I argue it should take presence over all command line arguments but hey not interested enough to debate about it. ---------------------------------------------------------------------- Thaddy · 2018-04-21 14:21 Quote from: taazz on April 21, 2018, 02:56:07 pmahh, good to know there is such a construct, now how I make sure it does not work in my units? Define in your main program. (*.lpr or the one that says program...) that will override it. Otherwise you can't override the command line. QuoteQuote from: Thaddy on April 21, 2018, 11:18:36 amNote this ony works for -ALL- units, NOT the main program. Defines in the main program override the command line instead. Quotewell as long as the define is explit inside the unit then I argue it should take presence over all command line arguments but hey not interested enough to debate about it. It does not....as per my example....Only the main program file overrides the command line. You can't have it both ways... ---------------------------------------------------------------------- taazz · 2018-04-21 17:11 Quote from: Thaddy on April 21, 2018, 04:21:14 pmQuote from: taazz on April 21, 2018, 02:56:07 pmahh, good to know there is such a construct, now how I make sure it does not work in my units? Define in your main program. (*.lpr or the one that says program...) that will override it. Otherwise you can't override the command line. QuoteQuote from: Thaddy on April 21, 2018, 11:18:36 amNote this ony works for -ALL- units, NOT the main program. Defines in the main program override the command line instead. Quotewell as long as the define is explit inside the unit then I argue it should take presence over all command line arguments but hey not interested enough to debate about it. It does not....as per my example....Only the main program file overrides the command line. You can't have it both ways... I do not want it both ways. ---------------------------------------------------------------------- Thaddy · 2018-04-21 19:01 Quote from: taazz on April 21, 2018, 07:11:27 pmI do not want it both ways. Good. ---------------------------------------------------------------------- taazz · 2018-04-21 21:14 Quote from: Thaddy on April 21, 2018, 09:01:09 pmQuote from: taazz on April 21, 2018, 07:11:27 pmI do not want it both ways. Good. thank you! Your approval means a lot. Now can I disable it? ---------------------------------------------------------------------- Thaddy · 2018-04-22 04:50 Summary: - {$define}/{$undef} works on a code block basis, not a unit basis - You can override both globally using the -u and -d options  from the compiler for any unit or code block except the main project file - You can not use -u and -d to override defines in the main project file: those will take precedence - that might be a bug, btw, not sure, any thoughts? -. - You likely need the -B option (full rebuild) as well to guarantee proper behavior. Basically you can not prevent this behavior. You either use these options or not. I usually don't use these options, but rely on what is specified in the sourcecode.(except for -dDEBUG and -dRELEASE). It can have unwanted side effects.