Given a property setting in an LFM how do you perform the equivalent in code? lazarus / 21-General ---------------------------------------------------------------------- vfclists · 2024-01-05 22:27 These are examples of property values in am LFM files. 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 EditLabel.AnchorSideRight.Control = edtTitleColors.ComboboxArrowBG = 15790320SelectedColor.BackPriority = 50Colors.TextBG = clWhiteTabStop = TrueCursorText = crIBeamColors.TextFont = clBlack  So if you have the string Code: [Select]EditLabel.AnchorSideRight.Control = edtTitle how do you check if all the elements in the property hierarchy are valid before trying to assign the value, ie  as an `EditLabel` property which in turn has a `AnchorSideRight` property which in turn has `Control` property. Most of the values assigned could be checked at compile time but there are too many, but IIRC there are some routines, concerning conversion of strings to enums and some other type checks. This question is prompted by [Bug in Lazarus 2023-12-23 build - lfm changes don't trigger recompilation](https://forum.lazarus.freepascal. org/index.php/topic,65753.msg501427/topicseen.html#new). Rather than go through the compile cycle I prefer to create an instance of the component and use try except blocks to find out those that don't exist, or if they exist and the values assigned to them are invalid, then use a script to bulk delete them. ---------------------------------------------------------------------- alpine · 2024-01-07 02:11 Quote from: vfclists on January 05, 2024, 11:27:30 pmSo if you have the string Code: [Select]EditLabel.AnchorSideRight.Control = edtTitle how do you check if all the elements in the property hierarchy are valid before trying to assign the value, ie  as an `EditLabel` property which in turn has a `AnchorSideRight` property which in turn has `Control` property. 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 TypInfo; if GetPropInfo(Instance, PropName) <> Nil then ; Just to note a few things: Not all items are properties into the *.lfm. Some of them are (nested) controls. All of the Lazarus/FPC sources are available. Form streaming code (i.e. loading) included - you can consult the sources to see how it's done. Components (e.g. controls, forms) can be freely loaded and saved in runtime from/to ordinary files and streams. Not just from embedded resources. You're free to use the typinfo and rttiutils units at any time to investigate/read/write properties as I have already replied to you here: https://forum.lazarus.freepascal.org/index.php/topic,65710.msg50 1061.html#msg501061 Finally, I think you should better formulate your questions and then you'll receive appropriate answers. ---------------------------------------------------------------------- vfclists · 2024-01-07 05:18 Quote from: alpine on January 07, 2024, 03:11:37 amQuote from: vfclists on January 05, 2024, 11:27:30 pmSo if you have the string Code: [Select]EditLabel.AnchorSideRight.Control = edtTitle how do you check if all the elements in the property hierarchy are valid before trying to assign the value, ie  as an `EditLabel` property which in turn has a `AnchorSideRight` property which in turn has `Control` property. 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 TypInfo; if GetPropInfo(Instance, PropName) <> Nil then ; Just to note a few things: Not all items are properties into the *.lfm. Some of them are (nested) controls. All of the Lazarus/FPC sources are available. Form streaming code (i.e. loading) included - you can consult the sources to see how it's done. Components (e.g. controls, forms) can be freely loaded and saved in runtime from/to ordinary files and streams. Not just from embedded resources. You're free to use the typinfo and rttiutils units at any time to investigate/read/write properties as I have already replied to you here: https://forum.lazarus.freepascal.org/index.php/topic,65710.msg50 1061.html#msg501061 Finally, I think you should better formulate your questions and then you'll receive appropriate answers. I've been away from Lazarus/Delphi for a while and have forgotten most the code I developed involving TypInfo. I just couldn't remember the names of the functions. The function name I was searching for was 'HasProperty', but that was clearly off target. I now remember it from Brian Long's article which goes back to the 90s. http://blong.com/Conferences/BorConUK98/DelphiRTTI/CB140.htm The amount of Delphi I've forgotten is probably more than I currently know. ---------------------------------------------------------------------- Thaddy · 2024-01-07 11:04 Then you should probably forget all of your old knowledge and concentrate on learning and investigating all the new RTTI features since. In both Delphi and Freepascal that has evolved a lot. ---------------------------------------------------------------------- PascalDragon · 2024-01-07 12:19 Quote from: vfclists on January 05, 2024, 11:27:30 pmSo if you have the string Code: [Select]EditLabel.AnchorSideRight.Control = edtTitle how do you check if all the elements in the property hierarchy are valid before trying to assign the value, ie  as an `EditLabel` property which in turn has a `AnchorSideRight` property which in turn has `Control` property. The streaming system is the one that instantiates the elements, after all you don't see any constructor calls inside your own forms for the published component fields. Quote from: Thaddy on January 07, 2024, 12:04:50 pmThen you should probably forget all of your old knowledge and concentrate on learning and investigating all the new RTTI features since. In both Delphi and Freepascal that has evolved a lot. That part of the RTTI hasn't changed in either Delphi or FPC/Lazarus.