Expand a Lazarus Unit lazarus / 31-LCL ---------------------------------------------------------------------- Weitentaaal · 2023-11-06 13:03 Hello, i did use this Unit: "UITypes" for my Modal Results. Now i wanted to expand the List of constants with a new one. What is the way of doing it ? is it possible to override/expand a Unit like this ? i wanted to add something like this:   mrApply = mrNone + 12; ---------------------------------------------------------------------- Zvoni · 2023-11-06 13:34 Quote from: Weitentaaal on November 06, 2023, 02:03:43 pmHello, i did use this Unit: "UITypes" for my Modal Results. Now i wanted to expand the List of constants with a new one. What is the way of doing it ? is it possible to override/expand a Unit like this ? i wanted to add something like this:   mrApply = mrNone + 12; ? 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 Uses UITypes; Const  mrApply = UITypes.mrNone + 12; ---------------------------------------------------------------------- Weitentaaal · 2023-11-06 13:41 Quote from: Zvoni on November 06, 2023, 02:34:52 pmQuote from: Weitentaaal on November 06, 2023, 02:03:43 pmHello, i did use this Unit: "UITypes" for my Modal Results. Now i wanted to expand the List of constants with a new one. What is the way of doing it ? is it possible to override/expand a Unit like this ? i wanted to add something like this:   mrApply = mrNone + 12; ? 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 Uses UITypes; Const  mrApply = UITypes.mrNone + 12;  my question was rather about extending units. am i allowed to just define something in any unit ?. ---------------------------------------------------------------------- Zvoni · 2023-11-06 15:38 Quote from: Weitentaaal on November 06, 2023, 02:41:22 pmQuote from: Zvoni on November 06, 2023, 02:34:52 pmQuote from: Weitentaaal on November 06, 2023, 02:03:43 pmHello, i did use this Unit: "UITypes" for my Modal Results. Now i wanted to expand the List of constants with a new one. What is the way of doing it ? is it possible to override/expand a Unit like this ? i wanted to add something like this:   mrApply = mrNone + 12; ? 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 Uses UITypes; Const  mrApply = UITypes.mrNone + 12;  my question was rather about extending units. am i allowed to just define something in any unit ?. Who's gonna prevent you doing that?? I've "extended" (to use your phrase) the "sqldb" und "sqlite3conn" units here locally to finally get the "ExpandedSQL"-API working. BUT: Be aware, that all gloves are off regarding support from the community, if THAT "extended" Unit stops working EDIT: To not get any false ideas: I made a "local" copy of the "sqldb" and "sqlite3conn", changed/extended them to suit my needs, and then i "Use(s)" those two instead of the "official" units. I'd not touch any "official" units with a very long poker exactly because of the above (support....) ---------------------------------------------------------------------- Weitentaaal · 2023-11-07 13:51 Thank you. i was just curious because in the source code of this example "https://www.freepascal.org/~michael/articles/cdcover/cdcover.pdf", there was the unit fpobserver changed. i then realized that he did copy the whole unit and changed the copy but it still  had the same unit name so i was a bit confused. ---------------------------------------------------------------------- KodeZwerg · 2023-11-07 14:04 I would either create a .inc file or a simple unit with my custom definitions, include it after all original units, that way you still can update the originals with newer but not loosing your custom things. ---------------------------------------------------------------------- marcov · 2023-11-08 12:09 For special cases (e.g. getting code for some historic compiler to run with minimal modifications), you can also use -Fa commandline parameter. This adds the unit specified to -Fa to every uses line (including the main programs), and is great to simulate identifiers that are in e.g.  unit system in the other compiler.