[SOLVED] Is setting an LCL property by index instead of name possible? lazarus / 31-LCL ---------------------------------------------------------------------- JCobb · 2018-03-29 20:44 Hello All, (Also, thanks for the replies to my previous posts -- very helpful!) I'm doing a test using the class constructor below. I was curious to know if it's possible to reference a component property by index or search for it via a string then set it once it's found. To explain what I'm doing, I'm reading basic form and controls data from a JSON file and building components based on the JSON data.  It would be nice to read the property name and value from JSON and set it in the control without having to write a procedure for evey property that I want to set. Thanks in advance! Jeff 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 constructor jsonFormPropClass.create();var  frm        : TForm;  PropList   : PPropList;  Info       : PTypeInfo;  AllPropCnt,  propCnt, i : Integer; begin  frm := TForm.Create(nil);  Info := TypeInfo(frm);  AllPropCnt := GetTypeData(Info)^.PropCount;  if AllPropCnt > 0 then  begin    GetMem(PropList, SizeOf(PPropInfo) * AllPropCnt);    try    propCnt := GetPropList(Info,[tkInteger,tkBool,tkInt64], PropList);    SetLength(formProp,propCnt);      for i := 0 to (propCnt-1) do        formProp := PropList^[i]^.Name;    finally      FreeMem(PropList);    frm.Free;    end;  end;end; ---------------------------------------------------------------------- JCobb · 2018-03-29 21:57 It seems I've solved my own problem (at least for simple values)  I suppose if I persist long enough I might actually get my head around this language!  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 procedure jsonFormPropClass.setProperty(var frm : TForm; prop : string; value: variant);begin     if (IsPublishedProp (frm,prop)) then        SetPropValue (frm,prop,value);end;