Reading Form Data lazarus / 31-LCL ---------------------------------------------------------------------- diogenes · 2025-10-09 07:59 When Lazarus compiles a GUI application, it integreates the .LFM data into the executable tu build the forms from them, right? If so, I'd like to read some data (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 Caption and 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 Visible properties, specifically) out of this to avoid defining the values a second time (which provokes bugs and other problems). Therefore, please tell me how to do this (a Lazarus Resource?) if, for example, the form has class 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 TExampleForm, the unut us 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 FEExample, and the variable where the form is stored is 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 ExampleForm. Thanks in advance! ---------------------------------------------------------------------- jamie · 2025-10-09 09:32 Humm, use a resourestring ? Not sure abt your question but the llm is already a resoure string. ---------------------------------------------------------------------- diogenes · 2025-10-09 14:02 I wat to read the data at runtime. As far as I know, the .lfm file is a tempalte for the Lazarus resource compiled in, or do I misunderstand something? ---------------------------------------------------------------------- Remy Lebeau · 2025-10-09 16:16 Quote from: diogenes on October 09, 2025, 09:59:09 amIf so, I'd like to read some data (Caption and Visible properties, specifically) out of this Why? What is the actual use-case here? Quote from: diogenes on October 09, 2025, 09:59:09 amto avoid defining the values a second time (which provokes bugs and other problems). Where are you defining values a second time? What bugs are you trying to avoid? What is stopping you from simply defining your own constants in your code, and then assigning those constants to your properties at runtime? This way, you don't need to rely on the design-time values at all. ---------------------------------------------------------------------- Martin_fr · 2025-10-09 16:28 I would have to spent some time researching this myself. So just top level pointers.... The properties are stored in the LFM file when the IDE edits the form. AFAIK: When you compiler your app/exe then the LFM is compiled into a binary format (same content, just binary encoded), and that is added to the resources (under a name derived from the forms (class?) name. So, you can open the resource and load that binary LFM from it (probably see TForm.Create). But that wont help you much. You need TReader and the correct "driver" for the binary format. Yet afaik, TReader will write the read content to the form (I don't know, maybe it can be redirected... / but you are in for a lot of work, even without redirecting). So why not just load (create) the form. That will not (yet) display it, but allow you to read all the values for its properties. If needs must, you can then destroy it again. ---------------------------------------------------------------------- Thaddy · 2025-10-09 16:42 Read/WriteComponent. Tstream supports it. ---------------------------------------------------------------------- diogenes · 2025-10-09 18:46 See, my idea is as follows: Of course I can just create the forms and then retrieve the data from the form instances, but I'd like to keep unloaded what the user doesn't need (yet), but I need the data mnentioned for creeating menu items to let the user access them when he wants them (form Caption converted into a menu item Caption)) and the information if the form ist to bee seen by default layout (by the way, I'm usier AnchorDockimng, which also provides non-default storage or loading of layout). Correct me, but shouldn't be the data for the form somehow compiled into the binary for creating at startup? If so, the initialization code obviously reads this data, and I'd like to know how it does that to get the data I neeed. I hope I'm clearer now. Sometimes, my English (non.-native) fails me.