Objects causes "Create" to become Invalid. lazarus / 31-LCL ---------------------------------------------------------------------- dgrhoads · 2023-07-01 03:56 When "Objects" is included in the Uses list, I find that commands that attempt to Create a variable no longer work.  "Create" is not found as an acceptable modifier.  For example   S := TStringList.Create; is described by the compiler as "Error idents no member "Create" and Fata.  Syntax Error, ";" expected but "Create" found. The attached program (for compiling only) compiles successfully when Objects is not in the Uses section.  However it does not compile successfully when Objects is present.  My example uses TStringList, but I have observed it with other items that need creation as well. Am I missing something so that this is correct behavior? ---------------------------------------------------------------------- Awkward · 2023-07-01 04:30 why you so wondering? "Objects" unit uses another object model base on "object", not "class". it can have similar (same name) objects but another methods, especially constructor/destructor. Really, it WILL have anothers. if you want to use standard modern model, you must use TStringList from "Classes" unit ---------------------------------------------------------------------- Handoko · 2023-07-01 04:36 @dgrhoads Because TStringList also is provided by Objects unit (see the attached screenshot), you need to tell the compiler if you wish to use TStringList from Classes unit: 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 var  sList : Classes.TStringList;begin  sList := Classes.TStringList.Create;end; ---------------------------------------------------------------------- paweld · 2023-07-01 05:44 or set Objects unit at first place in uses section ---------------------------------------------------------------------- dgrhoads · 2023-07-02 03:16 Thanks.  The change in order in the Uses list worked. I was unaware that TStringList occurred in both Objects and Classes.  Now I see how to discern that:  two entries for TStringList in the list of Lazarus objects, one for Objects and one for Classes. ---------------------------------------------------------------------- PascalDragon · 2023-07-02 18:17 Quote from: dgrhoads on July 02, 2023, 05:16:10 amI was unaware that TStringList occurred in both Objects and Classes.  Now I see how to discern that:  two entries for TStringList in the list of Lazarus objects, one for Objects and one for Classes. The Objects unit is for TP-style object types and the Classes unit is for Delphi-style class types. If you only use the later then there is no reason for you to use the Objects unit.