[Solved] Where is procedure Delete(), often used in old DELPHI code ? lazarus / 67-Windows ---------------------------------------------------------------------- PeterX · 2021-07-11 11:57 Hi, I searched the WWW but .. I searched the Forum but .. I have a old Delphi file where there was 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       begin        delete( s, length(s), 1);        ...      end;  Originally in uses there was 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  Windows,...  But with Interfaces  and JwaWindows  the  delete()  procedure cannot be found says the compiler .. I searched the LAZARUS installation folder and .. I found out, in Freepascal the delete function is in:  system.fpd Also in  systemh.inc line 1082 But it didn't help me jet .. Which Unit in USES do I need to be able to call   delete()  ? ---------------------------------------------------------------------- marcov · 2021-07-11 12:04 Delete, as all functions in system.fpd are built-ins. They are core language parts and built in to the compiler. The system.fpd is a mock declaration of them for the documentation system, as these functions are documented. Built-ins are always there (only depending on compiler mode), but they are documented as part of system. ---------------------------------------------------------------------- PeterX · 2021-07-11 12:07 Quote from: marcov on July 11, 2021, 02:04:59 pmDelete, as all functions in system.fpd are built-ins. They are core language parts and built in to the compiler. The system.fpd is a mock declaration of them for the documentation system, as these functions are documented. Built-ins are always there (only depending on compiler mode), but they are documented as part of system. Okay, but when commenting out Windows in USES, and using JwaWindows instead, I get xxx.pas(377,15) Error: Illegal expression I use {$mode objfpc}{$H+} Probably some other of my Units has also declared a delete() procedure or function. This is the only reason I could imagine, why delete() is hidden .. ---------------------------------------------------------------------- marcov · 2021-07-11 12:13 Quote from: PeterX on July 11, 2021, 02:07:27 pmProbably some other of my Units has also declared a delete() procedure or function. This is the only reason I could imagine, why delete() is hidden .. Just call system.delete() in such cases. And in general, just use Windows as much as possible, and if it has deficiencies, file bugs. Moreover, if you need jwa* stuff, use specific units rather than the jwawindows one. ---------------------------------------------------------------------- PeterX · 2021-07-11 12:20 [You where faster ..] ---------------------------------------------------------------------- PeterX · 2021-07-11 12:24 Quote from: marcov on July 11, 2021, 02:13:52 pmJust call system.delete() in such cases. And in general, just use Windows as much as possible, and if it has deficiencies, file bugs. Moreover, if you need jwa* stuff, use specific units rather than the jwawindows one. Hm, so I was wrong so many years ? Why should I still use Windows ? I thought I should avoid it .. ? ---------------------------------------------------------------------- marcov · 2021-07-11 12:27 Quote from: PeterX on July 11, 2021, 02:24:13 pmHm, so I was wrong so many years ? Why should I still use Windows ? Windows and the other non jwa windows unit are the core Windows units of FPC. Jwa was included because it was somewhat more expansive. But jwawindows was a bit less delphi compatible and its maintenance stopped before it went to 64-bit. For 64-bit in particular, use windows as much as possible. QuoteI thought I should avoid it .. ? How did you think that?  Maybe for portability concerns, but jwawindows won't help you there. ---------------------------------------------------------------------- PeterX · 2021-07-11 12:30 Quote from: marcov on July 11, 2021, 02:27:09 pmQuoteI thought I should avoid it .. ? How did you think that?  Maybe for portability concerns, but jwawindows won't help you there. Somehow I thought I would get closer to portability. But I must realize now, I must have misunderstood something .. ---------------------------------------------------------------------- PeterX · 2021-07-11 12:35 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  Interfaces,  Windows,  //JwaWindows,   LMessages,  //messages,  Okay, back to Windows. But keep on using LMessages ? ---------------------------------------------------------------------- marcov · 2021-07-11 12:36 Quote from: PeterX on July 11, 2021, 02:35:14 pmCode: 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  Interfaces,  Windows,  //JwaWindows,   LMessages,  //messages,  Okay, back to Windows. But keep on using LMessages ? Yes, lmessages is a LCL internal version of messages. IOW it emulates them on non Windows. But if you use Windows functionality it is not portable. Some functionality will only be available in a platform specific matter though, so it depends on how hard you need it to be portable. ---------------------------------------------------------------------- PeterX · 2021-07-11 12:44 Quote from: marcov on July 11, 2021, 02:36:44 pmYes, lmessages is a LCL internal version of messages. IOW it emulates them on non Windows. But if you use Windows functionality it is not portable. Some functionality will only be available in a platform specific matter though, so it depends on how hard you need it to be portable. Currently I have no need to write portable code, especially in this windows focused application I am working on atm. But maybe, probably, some day .. who knows .. If it's better to use the LCL lmessages, I'd use it instead of ol' messages.