(Solved)How To? lazarus / 61-Beginners ---------------------------------------------------------------------- JLWest · 2020-10-09 02:39 So the following code throws an error if i turn on the second line.  Is there a way to make this work? I want to set the Text in TEdit.Text to TEdit1.Text := ''; I know that Tedit.Text will work but I have 50 TEdits on a form. Thus the loop to enable them and I need to clear the text 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        for i:= 0 to ComponentCount-1 do        if Components[i] is TControl then begin            TControl(Components[i]).Enabled:=True;           TControl(Components[i]).text := '';                     { <===Error}        end;     end;                   Thanks ---------------------------------------------------------------------- bytebites · 2020-10-09 03:08 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      for i:= 0 to ComponentCount-1 do        if Components[i] is TEdit then begin            TControl(Components[i]).Enabled:=True;            TEdit(Components[i]).text := '';                            end;     end; ---------------------------------------------------------------------- JLWest · 2020-10-09 04:25 It didn't work as expected. Attached the program. It's  a very small demo. ---------------------------------------------------------------------- nummer8 · 2020-10-09 09:34 Form in demo project was not visible for me. My screen was to small. Changed the Form Left and Form Top to 0 in lfm file. After that the form was visible. I changed the procedure below in your project. That worked without errors or problems. 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 TForm1.ControlClearCB; var i : Integer;  begin       for i:= 0 to ComponentCount-1 do        if Components[i] is TEdit then begin        TEdit(Components[i]).text := '';        end;end; ---------------------------------------------------------------------- JLWest · 2020-10-09 15:52 Yes, Works great. Just what I was looking for, Thank You.