From larrydalton71 at gmail.com Mon Feb 6 14:27:23 2023 From: larrydalton71 at gmail.com (Larry Dalton) Date: Mon, 6 Feb 2023 08:27:23 -0500 Subject: [Lazarus] odbc driver Message-ID: Using lazrus 2.2 ORC1-fpc-3.2.2-win64 error message: Project MyAccessPractice raised exception class EODBCException with message 'Could not connect with connection string'DRIVER=[Microsoft Access Driver(*.mdb,*.accdb)]; DBQ=C:\Lazarus_MSAccess\MyAccess.accdb;' ODBC error details: LastReturnCode:SQL-ERROR;Record1:SqlState:IM4002;NativeError 0; Message:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified; Here is the code, copied from internet unit AccessUnit; {$mode objfpc}{$H+} interface uses Classes, SysUtils, odbcconn, SQLDB, DB, Forms, Controls, Graphics, Dialogs, DBGrids, StdCtrls; type { TForm1 } TForm1 = class(TForm) Button1: TButton; DataSource1: TDataSource; DBGrid1: TDBGrid; Label1: TLabel; ODBCConnection1: TODBCConnection; SQLQuery1: TSQLQuery; SQLTransaction1: TSQLTransaction; procedure Button1Click(Sender: TObject); private public end; var Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.Button1Click(Sender: TObject); begin ODBCConnection1.Driver:='Microsoft Access Driver (*.mdb,*.accdb)'; ODBCCOnnection1.params.add('DBQ='+ExtractFilePath(Application.ExeName)+'MyAccess.accdb'); ODBCConnection1.Connected:=TRUE; ODBCConnection1.KeepConnection:=TRUE; SqlTransaction1.DataBase:=OdbcConnection1; SqlQuery1.DataBase:=ODBCConnection1; SQLQuery1.UsePrimaryKeyAsKey:=False; SqlQuery1.SQL.Text:='Select * FROM Student'; Datasource1.DataSet:=Sqlquery1; DBGrid1.DataSource:=DataSource1; If ODBCConnection1.Connected then begin label1.Caption:='Connected'; end; SqlQuery1.Open; end; end. Current MS Access Driver Microsoft Access Driver (*.mdb,*,accdb) Version 16:00 15928020006 -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at freepascal.org Mon Feb 6 14:37:43 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Mon, 6 Feb 2023 14:37:43 +0100 (CET) Subject: [Lazarus] odbc driver In-Reply-To: References: Message-ID: On Mon, 6 Feb 2023, Larry Dalton via lazarus wrote: > Using lazrus 2.2 ORC1-fpc-3.2.2-win64 > error message: Project MyAccessPractice raised exception class > EODBCException with message > 'Could not connect with connection string'DRIVER=[Microsoft Access > Driver(*.mdb,*.accdb)]; > DBQ=C:\Lazarus_MSAccess\MyAccess.accdb;' ODBC error details: > LastReturnCode:SQL-ERROR;Record1:SqlState:IM4002;NativeError 0; > Message:[Microsoft][ODBC Driver Manager] Data source name not found and no > default driver specified; > > Here is the code, copied from internet > > unit AccessUnit; > {$mode objfpc}{$H+} > interface > uses > Classes, SysUtils, odbcconn, SQLDB, DB, Forms, Controls, Graphics, > Dialogs, > DBGrids, StdCtrls; > type > { TForm1 } > TForm1 = class(TForm) > Button1: TButton; > DataSource1: TDataSource; > DBGrid1: TDBGrid; > Label1: TLabel; > ODBCConnection1: TODBCConnection; > SQLQuery1: TSQLQuery; > SQLTransaction1: TSQLTransaction; > procedure Button1Click(Sender: TObject); > private > public > end; > var > Form1: TForm1; > > implementation > > {$R *.lfm} > > { TForm1 } > > procedure TForm1.Button1Click(Sender: TObject); > begin > ODBCConnection1.Driver:='Microsoft Access Driver (*.mdb,*.accdb)'; > ODBCCOnnection1.params.add('DBQ='+ExtractFilePath(Application.ExeName)+'MyAccess.accdb'); This should probably be ODBCCOnnection1.DatabaseName:=ExtractFilePath(Application.ExeName)+'MyAccess.accdb'; Michael. From werner.pamler at freenet.de Tue Feb 7 00:15:11 2023 From: werner.pamler at freenet.de (Werner Pamler) Date: Tue, 7 Feb 2023 00:15:11 +0100 Subject: [Lazarus] odbc driver In-Reply-To: References: Message-ID: <7d47ff83-ab22-38f7-2481-44d075f60338@freenet.de> Am 06.02.2023 um 14:27 schrieb Larry Dalton via lazarus: > procedure TForm1.Button1Click(Sender: TObject); > begin > ?ODBCConnection1.Driver:='Microsoft Access Driver (*.mdb,*.accdb)'; > ?ODBCCOnnection1.params.add('DBQ='+ExtractFilePath(Application.ExeName)+'MyAccess.accdb'); > ?ODBCConnection1.Connected:=TRUE; > ?ODBCConnection1.KeepConnection:=TRUE; > > Current MS Access Driver > Microsoft Access Driver (*.mdb,*,accdb) Version 16:00 15928020006 I have the same code in one of my test projects, and it is working. A problem could be that you seem to use the 64-bit IDE, but your database could be 32bit: My Access version (2016) only produces 32-bit databases. I get the same error message when I try to open a 32-bit accdb file in the 64-bit application. From larrydalton71 at gmail.com Tue Feb 7 00:46:40 2023 From: larrydalton71 at gmail.com (Larry Dalton) Date: Mon, 6 Feb 2023 18:46:40 -0500 Subject: [Lazarus] odbc driver In-Reply-To: <7d47ff83-ab22-38f7-2481-44d075f60338@freenet.de> References: <7d47ff83-ab22-38f7-2481-44d075f60338@freenet.de> Message-ID: <272893B0-13D9-42AD-AF56-AF754548678E@gmail.com> I wondered about that. Sent from my iPhone > On Feb 6, 2023, at 18:15, Werner Pamler via lazarus wrote: > > ?Am 06.02.2023 um 14:27 schrieb Larry Dalton via lazarus: >> procedure TForm1.Button1Click(Sender: TObject); >> begin >> ODBCConnection1.Driver:='Microsoft Access Driver (*.mdb,*.accdb)'; >> ODBCCOnnection1.params.add('DBQ='+ExtractFilePath(Application.ExeName)+'MyAccess.accdb'); >> ODBCConnection1.Connected:=TRUE; >> ODBCConnection1.KeepConnection:=TRUE; >> >> Current MS Access Driver >> Microsoft Access Driver (*.mdb,*,accdb) Version 16:00 15928020006 > I have the same code in one of my test projects, and it is working. A problem could be that you seem to use the 64-bit IDE, but your database could be 32bit: My Access version (2016) only produces 32-bit databases. I get the same error message when I try to open a 32-bit accdb file in the 64-bit application. > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus From larrydalton71 at gmail.com Tue Feb 7 00:54:39 2023 From: larrydalton71 at gmail.com (Larry Dalton) Date: Mon, 6 Feb 2023 18:54:39 -0500 Subject: [Lazarus] odbc driver In-Reply-To: <272893B0-13D9-42AD-AF56-AF754548678E@gmail.com> References: <272893B0-13D9-42AD-AF56-AF754548678E@gmail.com> Message-ID: Apparently that isn?t it. Running Access version 2301 64bit Sent from my iPhone > On Feb 6, 2023, at 18:46, Larry Dalton wrote: > > ?I wondered about that. > > Sent from my iPhone > >> On Feb 6, 2023, at 18:15, Werner Pamler via lazarus wrote: >> >> ?Am 06.02.2023 um 14:27 schrieb Larry Dalton via lazarus: >>> procedure TForm1.Button1Click(Sender: TObject); >>> begin >>> ODBCConnection1.Driver:='Microsoft Access Driver (*.mdb,*.accdb)'; >>> ODBCCOnnection1.params.add('DBQ='+ExtractFilePath(Application.ExeName)+'MyAccess.accdb'); >>> ODBCConnection1.Connected:=TRUE; >>> ODBCConnection1.KeepConnection:=TRUE; >>> >>> Current MS Access Driver >>> Microsoft Access Driver (*.mdb,*,accdb) Version 16:00 15928020006 >> I have the same code in one of my test projects, and it is working. A problem could be that you seem to use the 64-bit IDE, but your database could be 32bit: My Access version (2016) only produces 32-bit databases. I get the same error message when I try to open a 32-bit accdb file in the 64-bit application. >> >> -- >> _______________________________________________ >> lazarus mailing list >> lazarus at lists.lazarus-ide.org >> https://lists.lazarus-ide.org/listinfo/lazarus From larrydalton71 at gmail.com Tue Feb 7 02:05:31 2023 From: larrydalton71 at gmail.com (Larry Dalton) Date: Mon, 6 Feb 2023 20:05:31 -0500 Subject: [Lazarus] Fwd: odbc driver References: Message-ID: Sent from my iPhone Begin forwarded message: > From: Larry Dalton > Date: February 6, 2023 at 08:27:23 EST > To: Lazarus mailing list > Subject: odbc driver > > ? > Using lazrus 2.2 ORC1-fpc-3.2.2-win64 > error message: Project MyAccessPractice raised exception class EODBCException with message > 'Could not connect with connection string'DRIVER=[Microsoft Access Driver(*.mdb,*.accdb)]; > DBQ=C:\Lazarus_MSAccess\MyAccess.accdb;' ODBC error details: LastReturnCode:SQL-ERROR;Record1:SqlState:IM4002;NativeError 0; Message:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified; > > Here is the code, copied from internet > > unit AccessUnit; > {$mode objfpc}{$H+} > interface > uses > Classes, SysUtils, odbcconn, SQLDB, DB, Forms, Controls, Graphics, Dialogs, > DBGrids, StdCtrls; > type > { TForm1 } > TForm1 = class(TForm) > Button1: TButton; > DataSource1: TDataSource; > DBGrid1: TDBGrid; > Label1: TLabel; > ODBCConnection1: TODBCConnection; > SQLQuery1: TSQLQuery; > SQLTransaction1: TSQLTransaction; > procedure Button1Click(Sender: TObject); > private > public > end; > var > Form1: TForm1; > > implementation > > {$R *.lfm} > > { TForm1 } > > procedure TForm1.Button1Click(Sender: TObject); > begin > ODBCConnection1.Driver:='Microsoft Access Driver (*.mdb,*.accdb)'; > ODBCCOnnection1.params.add('DBQ='+ExtractFilePath(Application.ExeName)+'MyAccess.accdb'); > ODBCConnection1.Connected:=TRUE; > ODBCConnection1.KeepConnection:=TRUE; > > SqlTransaction1.DataBase:=OdbcConnection1; > > SqlQuery1.DataBase:=ODBCConnection1; > SQLQuery1.UsePrimaryKeyAsKey:=False; > SqlQuery1.SQL.Text:='Select * FROM Student'; > > Datasource1.DataSet:=Sqlquery1; > DBGrid1.DataSource:=DataSource1; > > If ODBCConnection1.Connected then > begin > label1.Caption:='Connected'; > end; > > SqlQuery1.Open; > end; > end. > > Current MS Access Driver > Microsoft Access Driver (*.mdb,*,accdb) Version 16:00 15928020006 > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Thu Feb 9 11:08:10 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 09 Feb 2023 11:08:10 +0100 Subject: [Lazarus] Install Lazarus 2.2.4 on Ubuntu 20.04 LTS and other Linux Message-ID: Need help after fpc/lazarus moved from subversion... So I have been using Lazarus/FPC on Linux for a long time now (12+ years) and I have installed from sources using subversion access to the release tags on the source svn server. I created a script I could use on all these platforms to do the complete installations of fpc, lazarus, dependencies and custom components etc. This has been done on various Linux distros like Ubuntu 14-16-18-20 and RaspberryPi since about 2014 until 2020 or so. Now after having paused my programming a bit over the Covid pandemic I am back and need to update my installations by adding the newest version 2.2.4. But meanwhile the subversion server I have used has been replaced by some other versioning system so my script does no longer work... So I am asking how can I install from scratch on Linux (Ubuntu on PC and PiOS for RaspberryPi) in such a way that the older versions can remain in place? I googled a bit and found references to some deb files to download and use as sources, but then was also stated that installing one version would remove any other (earlier or later) existing version, which I surely do not want. I need the 2.2.4 version to exist in parallel with my older versions 2.0.6, 2.0.8, 2.0.10 and 2.0.12, so I can still build my applications with either of them... Please advice! PS I also have Lazarus installed on Windows-10 but this is done using the official sourceforge installers (i.e. not from source) and has resulted in separate installations for these versions so I can build my code also for Windows. DS -- Bo Berglund Developer in Sweden From jmlandmesser at gmx.de Thu Feb 9 11:50:25 2023 From: jmlandmesser at gmx.de (John Landmesser) Date: Thu, 9 Feb 2023 11:50:25 +0100 Subject: [Lazarus] Install Lazarus 2.2.4 on Ubuntu 20.04 LTS and other Linux In-Reply-To: References: Message-ID: <71d8f6a5-3f15-1394-1160-66fe5c49da2d@gmx.de> Am 09.02.23 um 11:08 schrieb Bo Berglund via lazarus: > Need help after fpc/lazarus moved from subversion... > > So I have been using Lazarus/FPC on Linux for a long time now (12+ years) and I > have installed from sources using subversion access to the release tags on the > source svn server. > I created a script I could use on all these platforms to do the complete > installations of fpc, lazarus, dependencies and custom components etc. > > This has been done on various Linux distros like Ubuntu 14-16-18-20 and > RaspberryPi since about 2014 until 2020 or so. > > Now after having paused my programming a bit over the Covid pandemic I am back > and need to update my installations by adding the newest version 2.2.4. > > But meanwhile the subversion server I have used has been replaced by some other > versioning system so my script does no longer work... > > So I am asking how can I install from scratch on Linux (Ubuntu on PC and PiOS > for RaspberryPi) in such a way that the older versions can remain in place? > > I googled a bit and found references to some deb files to download and use as > sources, but then was also stated that installing one version would remove any > other (earlier or later) existing version, which I surely do not want. > > I need the 2.2.4 version to exist in parallel with my older versions 2.0.6, > 2.0.8, 2.0.10 and 2.0.12, so I can still build my applications with either of > them... > > Please advice! > > PS > I also have Lazarus installed on Windows-10 but this is done using the official > sourceforge installers (i.e. not from source) and has resulted in separate > installations for these versions so I can build my code also for Windows. > DS > > ?in my? simple script i changed just one line to get it working with new lazarus git sources: ? ' old svn code: ? #? svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus ? new code ( git needs to be installed ) ? git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus Alternative: look how its done by fpcupdeluxe: https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/tag/v2.2.0n good luck! JohnML From bo.berglund at gmail.com Thu Feb 9 12:30:52 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 09 Feb 2023 12:30:52 +0100 Subject: [Lazarus] Install Lazarus 2.2.4 on Ubuntu 20.04 LTS and other Linux References: <71d8f6a5-3f15-1394-1160-66fe5c49da2d@gmx.de> Message-ID: On Thu, 9 Feb 2023 11:50:25 +0100, John Landmesser via lazarus wrote: > > ? ' old svn code: > > ? #? svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus > > ? new code ( git needs to be installed ) > > ? git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus > Thanks, I have been doing this: svn co https://svn.freepascal.org/svn/fpc/tags/$FPCTAG/ $FPCVER svn co https://svn.freepascal.org/svn/lazarus/tags/$LAZTAG/ $LAZVER where the variables have been preset to for example FPCTAG=release_3_2_0 FPCVER=3.2.0 LAZTAG=lazarus_2_0_12 LAZVER=2.0.12 I have made sure that only tagged (stable) releases are used in my script. This could also be formulated like this to disconnect from the source repository: svn export https://svn.freepascal.org/svn/fpc/tags/$FPCTAG/ $FPCVER My problem with git clone is that it will pull way to much from the repository, basically *all* that has happened up until today and it would also get me the live development sources, which I do not want. git clone makes the local store contain everything past and present, right? Is there a way use git to: - Only get a specific release tag (how do I find which tag to use) - Only get the actual sources without the overhead (AKA export) I have not used GIT for anything myself, we are on Subversion.... -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Thu Feb 9 14:37:10 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 09 Feb 2023 14:37:10 +0100 Subject: [Lazarus] Install Lazarus 2.2.4 on Ubuntu 20.04 LTS and other Linux References: <71d8f6a5-3f15-1394-1160-66fe5c49da2d@gmx.de> Message-ID: On Thu, 9 Feb 2023 11:50:25 +0100, John Landmesser via lazarus wrote: > ? git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus > So I have found that this is a path forward: FPCTAG=release_3_2_2 FPCVER=3.2.2 LAZTAG=lazarus_2_2_4 LAZVER=2.2.4 ... cd $HOME/devel/fpc wget https://gitlab.com/freepascal.org/fpc/source/-/archive/$FPCTAG/source-$FPCTAG.tar.gz tar -xvf source-$FPCTAG.tar.gz mv source-$FPCTAG $FPCVER rm source-$FPCTAG.tar.gz cd $HOME/devel/lazarus wget https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/$LAZTAG/lazarus-$LAZTAG.tar.gz tar xvf lazarus-$LAZTAG.tar.gz mv lazarus-$LAZTAG 2.2.4 rm lazarus-$LAZTAG.tar.gz This brings over just the sourcefiles for fpc and lazarus into the correct directories with no extra stuff. Then the remainder of my install script should work (not yet done though). -- Bo Berglund Developer in Sweden From larrydalton71 at gmail.com Thu Feb 9 16:32:34 2023 From: larrydalton71 at gmail.com (Larry Dalton) Date: Thu, 9 Feb 2023 10:32:34 -0500 Subject: [Lazarus] create table doesn't store Message-ID: Using Lazarus 2.2 ORC1-fpc-e.w.w-win64, Windows 11 Microsoft Access 64 bit procedure TAccess_form.ExcelTestButtonClick(Sender: TObject); var create_string:string; begin ExcelTestQuery.Close; ExcelTestQuery.SQL.Clear; create_string:='CREATE TABLE TEST_TABLE'; ExcelTestQuery.SQL.Append(create_string); create_string:='[CUSTOMER STRING(40)]'; ExcelTestQuery.SQL.Append(create_string); Memo1.Lines:=ExcelTestQuery.SQL; ExcelTestQuery.ExecSQL; end; This code says it creates TEST_TABLE, but it doesn't store it in the database. If I click the button once, it apparently creates the table. If I then click it the second time, it gives me an error code that the table exists. If I close the application and look in the database, it doesn't exist. Then if I open the application again,it lets me create it again. Why is it not storing the table in the database? -------------- next part -------------- An HTML attachment was scrubbed... URL: From gabor at poczta.onet.pl Thu Feb 9 16:41:58 2023 From: gabor at poczta.onet.pl (gabor) Date: Thu, 9 Feb 2023 16:41:58 +0100 Subject: [Lazarus] create table doesn't store In-Reply-To: References: Message-ID: <9a3d1a26-0204-a457-8c73-e61017b6a227@poczta.onet.pl> W dniu 2023-02-09 o?16:32, Larry Dalton via lazarus pisze: > This code says it creates TEST_TABLE, but it doesn't store it in the > database. > If I click the button once, it apparently creates the table. > If I then click it the second time, it gives me an error code that the > table exists. > If I close the application and look in the database, it doesn't exist. > Then if I open the application again,it lets me create it again. > Why is it not storing the table in the database? > Maybe you should commit transaction after creating table? Micha?. From larrydalton71 at gmail.com Thu Feb 9 16:51:52 2023 From: larrydalton71 at gmail.com (Larry Dalton) Date: Thu, 9 Feb 2023 10:51:52 -0500 Subject: [Lazarus] create table doesn't store In-Reply-To: <9a3d1a26-0204-a457-8c73-e61017b6a227@poczta.onet.pl> References: <9a3d1a26-0204-a457-8c73-e61017b6a227@poczta.onet.pl> Message-ID: <4EA2D3F5-E684-4DC9-80EB-FE45165EF768@gmail.com> That worked, Michal. Thanks! Sent from my iPhone > On Feb 9, 2023, at 10:42, gabor via lazarus wrote: > > ?W dniu 2023-02-09 o 16:32, Larry Dalton via lazarus pisze: >> This code says it creates TEST_TABLE, but it doesn't store it in the database. >> If I click the button once, it apparently creates the table. >> If I then click it the second time, it gives me an error code that the table exists. >> If I close the application and look in the database, it doesn't exist. >> Then if I open the application again,it lets me create it again. >> Why is it not storing the table in the database? > > Maybe you should commit transaction after creating table? > > Micha?. > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus From bo.berglund at gmail.com Thu Feb 9 18:34:27 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 09 Feb 2023 18:34:27 +0100 Subject: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu Message-ID: The below is from an Ubuntu 20.04.5 LTS with Mate Desktop on an HP workstation laptop. I have retrieved the tagged release sources for fpc 3.2.2 and Lazarus 2.2.4 from gitlab and built the compiler and IDE on the command line. When I start the Lazarus IDE I get to the dialog "Welcome to Lazarus IDE 2.2.4" where all is well and dandy *EXCEPT* the last tab Fppkg... What it says is this: ------------------- File: /home/bosse/.config/fppkg.cfg Error: there is a problem with the Fppkg configuration. (Fppkg reports that the RTL is not installed.) You could try to restore the configuration files automatically, or adapt the configuration file manually. -------------------- In the root of $HOME I have files fppkg.cfg, fppkg.bak, .fpc.cfg and directory fppkg/ This machine also has an older version of Lazarus (2.0.12) with fpc 3.2.0, which runs just fine without this noise about fppkg. The same thing regarding fppkg happens on Windows 10 with Lazarus 2.2.4 installed using the official installer downloaded from Sourceforge. What does this mean? I have never seen this before in my many years of Lazarus usage... And what should I do to rectify it? -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Thu Feb 9 20:24:30 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 09 Feb 2023 20:24:30 +0100 Subject: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu References: Message-ID: On Thu, 09 Feb 2023 18:34:27 +0100, Bo Berglund via lazarus wrote: >What does this mean? > >I have never seen this before in my many years of Lazarus usage... > >And what should I do to rectify it? > I found this being discussed on gitlab: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/35254 and https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38684 Seems like there is no solution yet, am I right? So, should I just disregard it completely? -- Bo Berglund Developer in Sweden From giuliano.colla at fastwebnet.it Thu Feb 9 20:52:22 2023 From: giuliano.colla at fastwebnet.it (Giuliano Colla) Date: Thu, 9 Feb 2023 20:52:22 +0100 Subject: [Lazarus] Install Lazarus 2.2.4 on Ubuntu 20.04 LTS and other Linux In-Reply-To: References: <71d8f6a5-3f15-1394-1160-66fe5c49da2d@gmx.de> Message-ID: Il 09/02/23 14:37, Bo Berglund via lazarus ha scritto: > On Thu, 9 Feb 2023 11:50:25 +0100, John Landmesser via lazarus > wrote: > >> ? git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus >> > So I have found that this is a path forward: > > FPCTAG=release_3_2_2 > FPCVER=3.2.2 > LAZTAG=lazarus_2_2_4 > LAZVER=2.2.4 > > ... > > cd $HOME/devel/fpc > wget > https://gitlab.com/freepascal.org/fpc/source/-/archive/$FPCTAG/source-$FPCTAG.tar.gz > tar -xvf source-$FPCTAG.tar.gz > mv source-$FPCTAG $FPCVER > rm source-$FPCTAG.tar.gz > > cd $HOME/devel/lazarus > wget > https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/$LAZTAG/lazarus-$LAZTAG.tar.gz > tar xvf lazarus-$LAZTAG.tar.gz > mv lazarus-$LAZTAG 2.2.4 > rm lazarus-$LAZTAG.tar.gz > > This brings over just the sourcefiles for fpc and lazarus into the correct > directories with no extra stuff. > > Then the remainder of my install script should work (not yet done though). > > The best way I've found to solve this sort of problems is to use fpcupdeluxe, or at least the fpcupdeluxe technique. It just builds a fully isolated tree for each different Lazarus/fpc combinations you want. The trick for Lazarus is very simple, just a startup script pointing to the local Lazarus executable and configuration. For fpc, the fpc executable is just a fpc.sh which starts the local fpc with the local fpc config. On Linux I have two Lazarus 1.8 (one gtk2, the other Qt) with their fpc to support old applications, one Lazarus stable+fixes and one Lazarus trunk. On Mac Os the same. Give it a try. Giuliano From lazarus at mfriebe.de Thu Feb 9 21:05:13 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Thu, 9 Feb 2023 21:05:13 +0100 Subject: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu In-Reply-To: References: Message-ID: <5c3f9688-c5b8-b208-e52d-82b361639a43@mfriebe.de> On 09/02/2023 20:24, Bo Berglund via lazarus wrote: > On Thu, 09 Feb 2023 18:34:27 +0100, Bo Berglund via lazarus > wrote: > >> What does this mean? >> >> I have never seen this before in my many years of Lazarus usage... >> >> And what should I do to rectify it? >> > I found this being discussed on gitlab: > https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/35254 > > and > > https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38684 > > > Seems like there is no solution yet, am I right? > > So, should I just disregard it completely? > > In Lazarus trunk it can be disabled.... But before that.... tuff. Try to delete the old config by hand. Then -outside the IDE - use the latest (3.2.2) fppkg to create a new config. (may or may not need the fpc install in PATH) From bo.berglund at gmail.com Thu Feb 9 21:57:04 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 09 Feb 2023 21:57:04 +0100 Subject: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu References: <5c3f9688-c5b8-b208-e52d-82b361639a43@mfriebe.de> Message-ID: On Thu, 9 Feb 2023 21:05:13 +0100, Martin Frb via lazarus wrote: >On 09/02/2023 20:24, Bo Berglund via lazarus wrote: >> On Thu, 09 Feb 2023 18:34:27 +0100, Bo Berglund via lazarus >> wrote: >> >>> What does this mean? >>> >>> I have never seen this before in my many years of Lazarus usage... >>> >>> And what should I do to rectify it? >>> >> I found this being discussed on gitlab: >> https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/35254 >> >> and >> >> https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38684 >> >> >> Seems like there is no solution yet, am I right? >> >> So, should I just disregard it completely? >> >> >In Lazarus trunk it can be disabled.... > >But before that.... tuff. > When is the next release of Lazarus including this change due to be published? Version 2.2.4 seems to be quite old now. But I don't get it, every time I start up Lazarus in Ubuntu it pops up the dialog and no matter what I do inside it it is not accepted. If I start the IDE anyway from the dialog without doing anything it looks like Lazarus is working and I can build apps earlier built with 2.0.12. But shutting down Lazarus and then starting it, again shows the dialog. :-( And it seems to be looking for $HOME/.config/fppkg.cfg even though I am using separate install dirs for Lazarus 2.0.12 and 2.2.4 and the launch file lazarus_2.2.4.desktop contains --pcp=/home/bosse/.lazarus_2.2.4 So I would expect the location of the fppkg.cnf file to be inside that pcp dir, but it is not. Apart from that location (provided the fpc version is in play) there could be another location below $HOME/lib/fpc/3.2.2 that could be used, but the dialog does not accept that either. This is where make install for fpc copied a lot of files. >Try to delete the old config by hand. >Then -outside the IDE - use the latest (3.2.2) fppkg to create a new >config. (may or may not need the fpc install in PATH) Exactly what do you suggest here? - Which old config? File name and location please. - How do I use the new fpc to recreate it? I don't even know what it is.... Note that I must be able to run my existing Lazarus 2.0.12 until everything with 2.2.4 has been checked to work.. -- Bo Berglund Developer in Sweden From lazarus at mfriebe.de Thu Feb 9 22:37:20 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Thu, 9 Feb 2023 22:37:20 +0100 Subject: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu In-Reply-To: References: <5c3f9688-c5b8-b208-e52d-82b361639a43@mfriebe.de> Message-ID: <0f863424-ea5e-300a-d03c-c65fb644d84d@mfriebe.de> On 09/02/2023 21:57, Bo Berglund via lazarus wrote: > And it seems to be looking for $HOME/.config/fppkg.cfg even though I > am using > separate install dirs for Lazarus 2.0.12 and 2.2.4 and the launch file > lazarus_2.2.4.desktop contains --pcp=/home/bosse/.lazarus_2.2.4 > > So I would expect the location of the fppkg.cnf file to be inside that pcp dir, > but it is not. According to what I gathered info wise, fppkg only supports one config dir. (it has some options, but not sure the IDE uses those) So it does not work well for Lazarus multi install. The IDE will work fine without it. It' only needed if you need some of the few packages that are only avail via fppkg (though you can download them by hand anyway) >> Try to delete the old config by hand. >> Then -outside the IDE - use the latest (3.2.2) fppkg to create a new >> config. (may or may not need the fpc install in PATH) > Exactly what do you suggest here? > - Which old config? File name and location please. The one in your home folder (I don't have Linux path)... On Windows it's in %APPDATA%\Local\FreePascal\fppkg There are files like fppkg.cfg mirrors.xml packages.xml and some folders. > - How do I use the new fpc to recreate it? I don't even know what it is.... there is an fppkg utility in the fpc folder. (fppkg is part of fpc) If you just run it fppkg it should create a config file (if none exists). It wont say that it did, it just prints the help. (could be that fpc needs to be in path) > > Note that I must be able to run my existing Lazarus 2.0.12 until everything with > 2.2.4 has been checked to work.. It is a long time back since I last dealt with it (I now have it disabled...) It is not about the lazarus version, but different fpc versions. In my case (but maybe I was lucky) the older fpc didn't complain.... Anyway that is about what I remember from when I last fought with it.... Sorry, it's not much.... From bo.berglund at gmail.com Fri Feb 10 12:35:58 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 10 Feb 2023 12:35:58 +0100 Subject: [Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB? References: <61isshpn00t8vq7rab9cm7qa9aosvc4vqd@4ax.com> Message-ID: On Mon, 23 Jan 2023 09:59:14 +0100 (CET), Michael Van Canneyt via lazarus wrote: > > >On Mon, 23 Jan 2023, Bo Berglund via lazarus wrote: > >> I have a number of "older" applications developed on Windows using >> Delphi7-2007-XE5, which use ADODB for database accesses. >> The database is Microsoft SQLSERVER. >> >> Now I no longer have the old Borland software installed (issues with Windows 10 >> etc) so I want to port the projects to FPC/Lazarus. >> I have ported some other non-database applications which (with some effort) >> seems to have worked out OK. >> >> Now I am facing the challenge of doing it on an adodb database enabled >> application and I would like to know if there is some "compatible" way of doing >> it, which is described somewhere? > >Yes. > >You need to use SQLDB, and the TMSSQLConnection. > >See https://wiki.freepascal.org/SQLdb_Tutorial1 for a simple explanation. > >The page https://wiki.freepascal.org/SQLdb_Package also contains some explanations >for setup. > >There are some other pages in the wiki. > >A more in-depth explanation is in the lazarus book. > >Or you can look at > >https://www.freepascal.org/~michael/articles/ > >several articles discuss SQLDB, in particular: > >https://www.freepascal.org/~michael/articles/lazviddb/lazviddb.pdf > >That should be enough to get you started. > >Michael. Thanks! Almost there but not quite... I am using Lazarus 2.2.4 with fpc 3.2.2 on a Windows 10 box. The application seems to have been converted pretty well using the Lazarus Delphi Conversion function to migrate from Delphi with some extra defines needing adjustments. But these have been minor considering the size of the application. But the ADODB conversion is now halted on the TSqlQuery and TMSSQLConnection items which operate so differently from ADODB... I added this in uses: mssqlconn, //Had to add this in order to use TMSSQLConnection sqldb, This made the code pass the defines of the objects: TAppDbHandler = class private FConn: TMSSQLConnection; // TADOConnection; FQuery: TSQLQuery; // TADOQuery; FDatabaseServer, FDatabase, FConnString, FDbUser, FDbPassword, FUserName, FUserPassword: string; But next I get a lot of errors because of the differences between this and the Delphi ADODB we used before. I got lost here... constructor TAppDbHandler.Create; begin FConn := TMSSQLConnection.Create(NIL); //was: TADOConnection.Create(NIL); FQuery := TSQLQuery.Create(NIL); //was: TADOQuery.Create(NIL); FQuery.Connection := FConn; //<== Triggers an error FDatabaseServer := ReadRegString(HKEY_CURRENT_USER,'Software\...\AppManager','DatabaseServer','servername'); FDatabase := ReadRegString(HKEY_CURRENT_USER,'Software\...\AppManager','Database','APPMANAGER'); FConnString := 'Provider=SQLOLEDB.1;Persist Security Info=False;' + 'Network Library=DBMSSOCN;Data Source=' + FDatabaseServer + ';' + 'Initial Catalog=' + FDatabase; FDbUser := '****'; FDbPassword := '****'; end; Is there some example which does not use component drag-drop and properties settings in the GUI but does all of it in code towards MSSQLserver? That would probably help in setting up the database functions properly. -- Bo Berglund Developer in Sweden From michael at freepascal.org Fri Feb 10 14:00:32 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Fri, 10 Feb 2023 14:00:32 +0100 (CET) Subject: [Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB? In-Reply-To: References: <61isshpn00t8vq7rab9cm7qa9aosvc4vqd@4ax.com> Message-ID: On Fri, 10 Feb 2023, Bo Berglund via lazarus wrote: > On Mon, 23 Jan 2023 09:59:14 +0100 (CET), Michael Van Canneyt via lazarus > wrote: > >> >> >> On Mon, 23 Jan 2023, Bo Berglund via lazarus wrote: >> >>> I have a number of "older" applications developed on Windows using >>> Delphi7-2007-XE5, which use ADODB for database accesses. >>> The database is Microsoft SQLSERVER. >>> >>> Now I no longer have the old Borland software installed (issues with Windows 10 >>> etc) so I want to port the projects to FPC/Lazarus. >>> I have ported some other non-database applications which (with some effort) >>> seems to have worked out OK. >>> >>> Now I am facing the challenge of doing it on an adodb database enabled >>> application and I would like to know if there is some "compatible" way of doing >>> it, which is described somewhere? >> >> Yes. >> >> You need to use SQLDB, and the TMSSQLConnection. >> >> See https://wiki.freepascal.org/SQLdb_Tutorial1 for a simple explanation. >> >> The page https://wiki.freepascal.org/SQLdb_Package also contains some explanations >> for setup. >> >> There are some other pages in the wiki. >> >> A more in-depth explanation is in the lazarus book. >> >> Or you can look at >> >> https://www.freepascal.org/~michael/articles/ >> >> several articles discuss SQLDB, in particular: >> >> https://www.freepascal.org/~michael/articles/lazviddb/lazviddb.pdf >> >> That should be enough to get you started. >> >> Michael. > > Thanks! > > Almost there but not quite... > I am using Lazarus 2.2.4 with fpc 3.2.2 on a Windows 10 box. > > The application seems to have been converted pretty well using the Lazarus > Delphi Conversion function to migrate from Delphi with some extra defines > needing adjustments. But these have been minor considering the size of the > application. > > But the ADODB conversion is now halted on the TSqlQuery and TMSSQLConnection > items which operate so differently from ADODB... > > I added this in uses: > > mssqlconn, //Had to add this in order to use TMSSQLConnection > sqldb, > > This made the code pass the defines of the objects: > > TAppDbHandler = class > private > FConn: TMSSQLConnection; // TADOConnection; > FQuery: TSQLQuery; // TADOQuery; > FDatabaseServer, > FDatabase, > FConnString, > FDbUser, > FDbPassword, > FUserName, > FUserPassword: string; > > > But next I get a lot of errors because of the differences between this and the > Delphi ADODB we used before. > > I got lost here... > > constructor TAppDbHandler.Create; > begin > FConn := TMSSQLConnection.Create(NIL); //was: TADOConnection.Create(NIL); > FQuery := TSQLQuery.Create(NIL); //was: TADOQuery.Create(NIL); > FQuery.Connection := FConn; //<== Triggers an error FQuery.Database:=FConn; > FDatabaseServer := > ReadRegString(HKEY_CURRENT_USER,'Software\...\AppManager','DatabaseServer','servername'); > FDatabase := > ReadRegString(HKEY_CURRENT_USER,'Software\...\AppManager','Database','APPMANAGER'); > FConnString := 'Provider=SQLOLEDB.1;Persist Security Info=False;' + > 'Network Library=DBMSSOCN;Data Source=' + FDatabaseServer + ';' > + > 'Initial Catalog=' + FDatabase; > FDbUser := '****'; > FDbPassword := '****'; > end; > > > Is there some example which does not use component drag-drop and properties > settings in the GUI but does all of it in code towards MSSQLserver? Try this: FConn.DatabaseName:=FDatabase; FConn.HostName:=FDatabaseServer; FConn.Params.Add('Provider=SQLOLEDB.1'); FConn.Params.Add('Persist Security Info=False'); FConn.Params.Add('Network Library=DBMSSOCN'); FConn.UserName:=FDbUser; FConn.PasswWord:=FDBPassword; it is all pretty generic. I am not sure that the Params are needed, they look more like some ODBC/ADO specific things. The MS-SQL connection of Free Pascal does not use ODBC/ADO. So I would start without the params, only add them if it does not work without them. One thing: make sure your SQL server accepts TCP/IP connections. You must do this in the Microsoft Management Console. Google is your friend there. Michael. From bo.berglund at gmail.com Sat Feb 11 11:58:04 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 11 Feb 2023 11:58:04 +0100 Subject: [Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB? References: <61isshpn00t8vq7rab9cm7qa9aosvc4vqd@4ax.com> Message-ID: On Fri, 10 Feb 2023 14:00:32 +0100 (CET), Michael Van Canneyt via lazarus wrote: > > >On Fri, 10 Feb 2023, Bo Berglund via lazarus wrote: > >> On Mon, 23 Jan 2023 09:59:14 +0100 (CET), Michael Van Canneyt via lazarus >> wrote: >> >>> >>> >>> On Mon, 23 Jan 2023, Bo Berglund via lazarus wrote: >>> >>>> I have a number of "older" applications developed on Windows using >>>> Delphi7-2007-XE5, which use ADODB for database accesses. >>>> The database is Microsoft SQLSERVER. >>>> >>>> Now I no longer have the old Borland software installed (issues with Windows 10 >>>> etc) so I want to port the projects to FPC/Lazarus. >>>> I have ported some other non-database applications which (with some effort) >>>> seems to have worked out OK. >>>> >>>> Now I am facing the challenge of doing it on an adodb database enabled >>>> application and I would like to know if there is some "compatible" way of doing >>>> it, which is described somewhere? >>> >>> Yes. >>> >>> You need to use SQLDB, and the TMSSQLConnection. >>> >>> See https://wiki.freepascal.org/SQLdb_Tutorial1 for a simple explanation. >>> >>> The page https://wiki.freepascal.org/SQLdb_Package also contains some explanations >>> for setup. >>> >>> There are some other pages in the wiki. >>> >>> A more in-depth explanation is in the lazarus book. >>> >>> Or you can look at >>> >>> https://www.freepascal.org/~michael/articles/ >>> >>> several articles discuss SQLDB, in particular: >>> >>> https://www.freepascal.org/~michael/articles/lazviddb/lazviddb.pdf >>> >>> That should be enough to get you started. >>> >>> Michael. >> >> Thanks! >> >> Almost there but not quite... >> I am using Lazarus 2.2.4 with fpc 3.2.2 on a Windows 10 box. >> >> The application seems to have been converted pretty well using the Lazarus >> Delphi Conversion function to migrate from Delphi with some extra defines >> needing adjustments. But these have been minor considering the size of the >> application. >> >> But the ADODB conversion is now halted on the TSqlQuery and TMSSQLConnection >> items which operate so differently from ADODB... >> >> I added this in uses: >> >> mssqlconn, //Had to add this in order to use TMSSQLConnection >> sqldb, >> >> This made the code pass the defines of the objects: >> >> TAppDbHandler = class >> private >> FConn: TMSSQLConnection; // TADOConnection; >> FQuery: TSQLQuery; // TADOQuery; >> FDatabaseServer, >> FDatabase, >> FConnString, >> FDbUser, >> FDbPassword, >> FUserName, >> FUserPassword: string; >> >> >> But next I get a lot of errors because of the differences between this and the >> Delphi ADODB we used before. >> >> I got lost here... >> >> constructor TAppDbHandler.Create; >> begin >> FConn := TMSSQLConnection.Create(NIL); //was: TADOConnection.Create(NIL); >> FQuery := TSQLQuery.Create(NIL); //was: TADOQuery.Create(NIL); >> FQuery.Connection := FConn; //<== Triggers an error > >FQuery.Database:=FConn; > >> FDatabaseServer := >> ReadRegString(HKEY_CURRENT_USER,'Software\...\AppManager','DatabaseServer','servername'); >> FDatabase := >> ReadRegString(HKEY_CURRENT_USER,'Software\...\AppManager','Database','APPMANAGER'); >> FConnString := 'Provider=SQLOLEDB.1;Persist Security Info=False;' + >> 'Network Library=DBMSSOCN;Data Source=' + FDatabaseServer + ';' >> + >> 'Initial Catalog=' + FDatabase; >> FDbUser := '****'; >> FDbPassword := '****'; >> end; >> >> >> Is there some example which does not use component drag-drop and properties >> settings in the GUI but does all of it in code towards MSSQLserver? > >Try this: > >FConn.DatabaseName:=FDatabase; >FConn.HostName:=FDatabaseServer; >FConn.Params.Add('Provider=SQLOLEDB.1'); >FConn.Params.Add('Persist Security Info=False'); >FConn.Params.Add('Network Library=DBMSSOCN'); >FConn.UserName:=FDbUser; >FConn.PasswWord:=FDBPassword; > >it is all pretty generic. I am not sure that the Params are needed, they >look more like some ODBC/ADO specific things. The MS-SQL connection of Free >Pascal does not use ODBC/ADO. So I would start without the params, >only add them if it does not work without them. > >One thing: make sure your SQL server accepts TCP/IP connections. >You must do this in the Microsoft Management Console. >Google is your friend there. I found this tutorial: https://www.streetinfo.lu/computing/lazarus/project/use_mssql.html It is still using RAD style drag-drop of the database components... But from it I could deduce what seems to be what is needed for my conversion. I have set up the constructor such: constructor TAppDbHandler.Create; begin FConn := TMSSQLConnection.Create(NIL); //was TADOConnection.Create(NIL); FTrans := TSQLTransaction.Create(NIL); FQuery := TSQLQuery.Create(NIL); // was TADOQuery.Create(NIL); FConn.Transaction := FTrans; FTrans.DataBase := FConn; FQuery.Transaction := FTrans; FDatabaseServer := ReadRegString(HKEY_CURRENT_USER,'Software\Mycompany\AppManager','DatabaseServer','servername'); FConn.HostName := FDatabaseServer; FDatabase := ReadRegString(HKEY_CURRENT_USER,'Software\Mycompany\AppManager','Database','APPMANAGER'); FConn.DatabaseName := FDatabase; FDbUser := 'username'; FDbPassword := 'userpassword'; FConn.UserName := FDbUser; FConn.Password := FDbPassword; end; And the connection handlers: function TAppDbHandler.OpenConnection: boolean; begin try Result := false; CloseConnection; FConn.LoginPrompt := false; FConn.Open; Result := FConn.Connected; except //placeholder end; if not Result then MessageDlg('Could not connect to database!', mtError, [mbOk], 0); end; procedure TAppDbHandler.CloseConnection; begin if FConn.Connected then FConn.Close; end; But I have not been able to check this because now compilation stops at a strange error regarding bitmaps... I am using a QRcode generation unit I got from GitHub long time ago (https://github.com/foxitsoftware/DelphiZXingQRCode) and it deals with TBitmap but when I test compile my app I get this in the main form code: var QR_BMP_SSM: TBitMap; ... begin ... (!) QR_BMP_SSM := TBitMap.Create; //<== Error here Error messages: Compile Project, Target: lib\x86_64-win64\AppManager.exe: Exit code 1, Errors: 2 FormAppManager.pas(410,25) Error: identifier idents no member "Create" FormAppManager.pas(410,25) Fatal: Syntax error, ";" expected but "identifier CREATE" found But after some digging around I removed this error by moving Graphics to next to last in the form pas file uses list.... Strange. Now I have gotten the project to build so I should start debugging. But when I try to run it from within Lazarus (hit the green arrow button) then a pop-up image appears: ------------------------------------------------------------------------------ Enable Dwarf 2 (-gw)? The project does not write debug info in Dwarf format. The "FpDebug internal Dwarf-debugger" supports only Dwarf. [Enable Dwarf2 with sets] [Enable Dwarf2 (-gw)] [Enable Dwarf3 (-gw3) [Cancel] ------------------------------------------------------------------------------ What am I supposed to do with this? -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Sat Feb 11 12:23:43 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 11 Feb 2023 12:23:43 +0100 Subject: [Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB? References: <61isshpn00t8vq7rab9cm7qa9aosvc4vqd@4ax.com> Message-ID: <12ueuh96rib0de95m6qj5djij78jcktna1@4ax.com> On Sat, 11 Feb 2023 11:58:04 +0100, Bo Berglund via lazarus wrote: >Now I have gotten the project to build so I should start debugging. > >But when I try to run it from within Lazarus (hit the green arrow button) then a >pop-up image appears: > >------------------------------------------------------------------------------ >Enable Dwarf 2 (-gw)? >The project does not write debug info in Dwarf format. The "FpDebug internal >Dwarf-debugger" supports only Dwarf. >[Enable Dwarf2 with sets] [Enable Dwarf2 (-gw)] [Enable Dwarf3 (-gw3) [Cancel] >------------------------------------------------------------------------------ > >What am I supposed to do with this? After reading up on the Wiki: https://wiki.freepascal.org/DWARF I selected Dwarf2 with sets. Then rebuilt and tried to run, but I get an immediate fatal exception! This happens both when starting within Lazarus and from the exe file itself. Message: -------------------------------------------------------- | Project AppManager raised exception class 'External: | | ACCESS VIOLATION' with message: | | Access violation reading from address | | $0000000000000040 | | | | At adress 1000096AD [OK] | -------------------------------------------------------- How can I find the cause of this exception? -- Bo Berglund Developer in Sweden From lazarus at mfriebe.de Sat Feb 11 16:31:56 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Sat, 11 Feb 2023 16:31:56 +0100 Subject: [Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB? In-Reply-To: <12ueuh96rib0de95m6qj5djij78jcktna1@4ax.com> References: <61isshpn00t8vq7rab9cm7qa9aosvc4vqd@4ax.com> <12ueuh96rib0de95m6qj5djij78jcktna1@4ax.com> Message-ID: On 11/02/2023 12:23, Bo Berglund via lazarus wrote: > > > Then rebuilt and tried to run, but I get an immediate fatal exception! > This happens both when starting within Lazarus and from the exe file itself. > Message: > -------------------------------------------------------- > | Project AppManager raised exception class 'External: | > | ACCESS VIOLATION' with message: | > | Access violation reading from address | > | $0000000000000040 | > | | > | At adress 1000096AD [OK] | > -------------------------------------------------------- > > How can I find the cause of this exception? > Did the debugger jump to any source code? What does the "Callstack" window show? If neither shows anything, the error might be in the RTL or kernel. What does the assembler win show? Give the data from the error message, I guess there is a nil pointer deref (e.g. access to a field in an object that is nil) From bo.berglund at gmail.com Sat Feb 11 21:01:49 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 11 Feb 2023 21:01:49 +0100 Subject: [Lazarus] Porting Delphi (2007/XE5) application, how to handle ADODB? References: <61isshpn00t8vq7rab9cm7qa9aosvc4vqd@4ax.com> <12ueuh96rib0de95m6qj5djij78jcktna1@4ax.com> Message-ID: On Sat, 11 Feb 2023 16:31:56 +0100, Martin Frb via lazarus wrote: >On 11/02/2023 12:23, Bo Berglund via lazarus wrote: >> >> >> Then rebuilt and tried to run, but I get an immediate fatal exception! >> This happens both when starting within Lazarus and from the exe file itself. >> Message: >> -------------------------------------------------------- >> | Project AppManager raised exception class 'External: | >> | ACCESS VIOLATION' with message: | >> | Access violation reading from address | >> | $0000000000000040 | >> | | >> | At adress 1000096AD [OK] | >> -------------------------------------------------------- >> >> How can I find the cause of this exception? >> > >Did the debugger jump to any source code? >What does the "Callstack" window show? > >If neither shows anything, the error might be in the RTL or kernel. What >does the assembler win show? > >Give the data from the error message, I guess there is a nil pointer >deref (e.g. access to a field in an object that is nil) When I wrote my last post I had problems finding a location to put a breakpoint so I could step through the code. But later I found by trial-and-error where the exception was coming from in general. And where I could put a breakpoint to start stepping from. It is from a logging component I have used on Delphi since more than 20 years. When it starts its logging it is supposed to read the application version info and write a start entry to today's log including the application version etc. When I moved some applications from Delohi on Windows to Lazarus on Linux I had to make a clone of the logging component where a lot of dependencies on external components for reading version etc was removed and instead the Lazarus/fpc handling was taken into account. Then it has worked fine on Lazarus at least on Linux. When porting the current application I changed the Class name for the logging component correspondingly and hoped it would be enough, but unfortunately it is not. I don't know where I should fix it yet and I don't have time to do it now when I am busy just porting the handler application. So for now I commented out all calls to the logger creation (where the exception happened) and its use so I can move on. Success! This has brought me to the verification that now the ported app is actually working regarding access to the MSSQL database! :-) The DB conmnection is needed in order to start up the app at all, without a database verified login it just shuts down. But it IS working with the MSSQLSERVER just fine so far. But I have another problem I will describe in a new thread... -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Sat Feb 11 21:15:25 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 11 Feb 2023 21:15:25 +0100 Subject: [Lazarus] How to make TBitButton set the ModalResult properly and close the form? Message-ID: I am porting a Windows application from Delphi2007 to Lazarus/Fpc and have run into problems with the dialog forms used in the app. They are all provided with two TBitButton buttons, one for OK and the other for Cancel. But unlike how it works on Delphi when I use any of these when running the ported app nothing at all happens! Luckily I have kept the close button on the form border so it can be closed that way. But then I cannot get any confirmation back to the main application... So in order to fix this on the first form I have had to implement the OnClick event and code the following into them: ModalResult := mrOk (or mrCancel) as needed. This causes the wanted behaviour. But this was not how the Delphi TBitButton operated, why has it changed? And is there some way I can restore this functionality without having to add OnClick event handlers to all of these buttons? Some special $MODE setting perhaps? The Delphi converter I used in Lazarus to port the application put {$MODE Delphi} into most units.. I have a queue of utilities I need to port so it would be good not having to deal with all of these dialogs... -- Bo Berglund Developer in Sweden From gabor at poczta.onet.pl Sat Feb 11 21:26:44 2023 From: gabor at poczta.onet.pl (gabor) Date: Sat, 11 Feb 2023 21:26:44 +0100 Subject: [Lazarus] How to make TBitButton set the ModalResult properly and close the form? In-Reply-To: References: Message-ID: W dniu 2023-02-11 o?21:15, Bo Berglund via lazarus pisze: > I am porting a Windows application from Delphi2007 to Lazarus/Fpc and have run > into problems with the dialog forms used in the app. > They are all provided with two TBitButton buttons, one for OK and the other for > Cancel. > > But unlike how it works on Delphi when I use any of these when running the > ported app nothing at all happens! Luckily I have kept the close button on the > form border so it can be closed that way. > But then I cannot get any confirmation back to the main application... > > So in order to fix this on the first form I have had to implement the OnClick > event and code the following into them: > > ModalResult := mrOk > (or mrCancel) as needed. > > This causes the wanted behaviour. > > But this was not how the Delphi TBitButton operated, why has it changed? > And is there some way I can restore this functionality without having to add > OnClick event handlers to all of these buttons? > Some special $MODE setting perhaps? > > The Delphi converter I used in Lazarus to port the application put > {$MODE Delphi} > into most units.. > > I have a queue of utilities I need to port so it would be good not having to > deal with all of these dialogs... > > Have you set the TBitButton.ModalResult property or TBitButton.Kind property appropriately? Micha?. From bartjunk64 at gmail.com Sat Feb 11 23:24:31 2023 From: bartjunk64 at gmail.com (Bart) Date: Sat, 11 Feb 2023 23:24:31 +0100 Subject: [Lazarus] How to make TBitButton set the ModalResult properly and close the form? In-Reply-To: References: Message-ID: On Sat, Feb 11, 2023 at 9:26 PM gabor via lazarus wrote: > Have you set the TBitButton.ModalResult property or TBitButton.Kind > property appropriately? This would normally also set ModalResult to mrOk (Kind := bkOK) or mrCancle (Kind := bkCancel). Setting the modalresult to those values should be enough (no OnClick needed) to close the modal form. It definitively does so for me. -- Bart From coppolastudio at gmail.com Sun Feb 12 10:48:23 2023 From: coppolastudio at gmail.com (Salvatore Coppola) Date: Sun, 12 Feb 2023 10:48:23 +0100 Subject: [Lazarus] How to make TBitButton set the ModalResult properly and close the form? In-Reply-To: References: Message-ID: Did you call the form with Form2.ShowModal? Ottieni BlueMail per Android Il giorno 11 Feb 2023, 23:26, alle ore 23:26, Bart via lazarus ha scritto: >On Sat, Feb 11, 2023 at 9:26 PM gabor via lazarus > wrote: > >> Have you set the TBitButton.ModalResult property or TBitButton.Kind >> property appropriately? > >This would normally also set ModalResult to mrOk (Kind := bkOK) or >mrCancle (Kind := bkCancel). >Setting the modalresult to those values should be enough (no OnClick >needed) to close the modal form. >It definitively does so for me. > >-- >Bart >-- >_______________________________________________ >lazarus mailing list >lazarus at lists.lazarus-ide.org >https://lists.lazarus-ide.org/listinfo/lazarus -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Sun Feb 12 14:11:47 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 12 Feb 2023 14:11:47 +0100 Subject: [Lazarus] How to make TBitButton set the ModalResult properly and close the form? References: Message-ID: On Sat, 11 Feb 2023 21:15:25 +0100, Bo Berglund via lazarus wrote: >So in order to fix this on the first form I have had to implement the OnClick >event and code the following into them: > >ModalResult := mrOk >(or mrCancel) as needed. > >This causes the wanted behaviour. > >But this was not how the Delphi TBitButton operated, why has it changed? >And is there some way I can restore this functionality without having to add >OnClick event handlers to all of these buttons? >Some special $MODE setting perhaps? > >The Delphi converter I used in Lazarus to port the application put >{$MODE Delphi} >into most units.. It might be the converter that does this... It made a new lfm file from the dfm that Delphi had made and maybe it did not transfer the button kind properly so that the modalresult was not set as it would be when the kind was selected... Anyway by going over the forms and changing ModalResult to the proper value depending on the Kind property value made it work as expected. No OnClick event handler needed. Now working properly. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Sun Feb 12 14:44:31 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 12 Feb 2023 14:44:31 +0100 Subject: [Lazarus] Using packages for often used units across projects? Message-ID: <9vphuhh0meke1198mc90ham2jd9l92h3m0@4ax.com> I am working on porting a set of applications (company internal tools and utilities mostly) from Delphi to FPC/Lazarus and now I have encountered use of a number of same units in several different applications. It seems not so good to copy the files into each project. In Delphi they were accessed from one location by several projects by using search path settings (not available in Lazarus). So now I wonder if one can put several really non-related units in a common package such that they will be available in every application from Lazarus? I.e. package lazcommon containing 5+ different units defining various classes and compiled by the package handler. So I am not talking about a package implementing a common typoe of actions like Internet communications or some graphics hanling or such, just a container that would simplify using commonly used units like for serial comm, application logging, special graphics etc These files would not have a GUI impact at all, never placed on a form and not configured in the GUI... So this package would not be installed, just compiled in the package manager. If this is how it can be done, is there some tutorial (for dummies) that handles the way it is done? I found the wiki page: https://wiki.lazarus.freepascal.org/Lazarus_Packages it seems not to describe my use case, I believe. But it is too dense for me to really understand it all... -- Bo Berglund Developer in Sweden From badsector at runtimeterror.com Sun Feb 12 15:30:58 2023 From: badsector at runtimeterror.com (Kostas Michalopoulos) Date: Sun, 12 Feb 2023 16:30:58 +0200 Subject: [Lazarus] Using packages for often used units across projects? In-Reply-To: <9vphuhh0meke1198mc90ham2jd9l92h3m0@4ax.com> References: <9vphuhh0meke1198mc90ham2jd9l92h3m0@4ax.com> Message-ID: <93521bc9-69e7-a7c5-8e00-c1ff2d9e0f09@runtimeterror.com> On 2/12/23 15:44, Bo Berglund via lazarus wrote: > It seems not so good to copy the files into each project. In Delphi they were > accessed from one location by several projects by using search path settings > (not available in Lazarus). You can set per-project unit search paths. This is available from Project -> Project Options -> Compiler Options (in the tree at the left side) -> Paths (below Compiler Options -> the "Other unit files" entry (you can use the ... button to edit the paths individually). > So now I wonder if one can put several really non-related units in a common > package such that they will be available in every application from Lazarus? > I.e. package lazcommon containing 5+ different units defining various classes > and compiled by the package handler. Yes you can also use packages for this. Simply make a new package, click the "Add" button, click "Add Files from File System" and select the files you want to add to the package. Save, compile and the package is done. To use the package from a project, either a) open the package itself and click "Use" and then "Add to project" or b) open the project's inspector from Project -> Project Inspector, click "Add", click "New requirement" and find the package name in the dialog box. You don't need to have any components or GUI in the package (though if you want it is possible to have components, GUI and forms in them). Kostas From luca at wetron.es Sun Feb 12 15:35:27 2023 From: luca at wetron.es (Luca Olivetti) Date: Sun, 12 Feb 2023 15:35:27 +0100 Subject: [Lazarus] Using packages for often used units across projects? In-Reply-To: <9vphuhh0meke1198mc90ham2jd9l92h3m0@4ax.com> References: <9vphuhh0meke1198mc90ham2jd9l92h3m0@4ax.com> Message-ID: El 12/2/23 a les 14:44, Bo Berglund via lazarus ha escrit: > I found the wiki page: > https://wiki.lazarus.freepascal.org/Lazarus_Packages > > it seems not to describe my use case, I believe. Actually it does, if you follow the heading "5.4 Creating a package for your common units" right at the beginning of the page https://wiki.lazarus.freepascal.org/Lazarus_Packages#Creating_a_package_for_your_common_units Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From bo.berglund at gmail.com Sun Feb 12 23:00:50 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 12 Feb 2023 23:00:50 +0100 Subject: [Lazarus] Using packages for often used units across projects? References: <9vphuhh0meke1198mc90ham2jd9l92h3m0@4ax.com> Message-ID: On Sun, 12 Feb 2023 15:35:27 +0100, Luca Olivetti via lazarus wrote: >El 12/2/23 a les 14:44, Bo Berglund via lazarus ha escrit: > >> I found the wiki page: >> https://wiki.lazarus.freepascal.org/Lazarus_Packages >> >> it seems not to describe my use case, I believe. > >Actually it does, if you follow the heading "5.4 Creating a package for >your common units" right at the beginning of the page > >https://wiki.lazarus.freepascal.org/Lazarus_Packages#Creating_a_package_for_your_common_units > > >Bye Thanks Luca! This is what I was looking for. :) -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Tue Feb 14 10:06:50 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 14 Feb 2023 10:06:50 +0100 Subject: [Lazarus] Using packages for often used units across projects? References: <9vphuhh0meke1198mc90ham2jd9l92h3m0@4ax.com> Message-ID: On Sun, 12 Feb 2023 15:35:27 +0100, Luca Olivetti via lazarus wrote: > >https://wiki.lazarus.freepascal.org/Lazarus_Packages#Creating_a_package_for_your_common_units > > Follow-up question: ------------------- Suppose I make a package with about 10 non-GUI utility units and use the Package Manager to compile them so they will be known to new projects if I add a dependency to this package. Then in a new project I put a single one of the units into my uses clause, will then the compile include just that unit or will it grab all of the package content into the resulting binary? I hope that it will just compile the specified unit into the program and not the complete package, but want to check this in case I am not understanding how it works.... -- Bo Berglund Developer in Sweden From nc-gaertnma at netcologne.de Tue Feb 14 10:19:29 2023 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Tue, 14 Feb 2023 10:19:29 +0100 Subject: [Lazarus] Using packages for often used units across projects? In-Reply-To: References: <9vphuhh0meke1198mc90ham2jd9l92h3m0@4ax.com> Message-ID: <20230214101929.4c80695f@limapholos> On Tue, 14 Feb 2023 10:06:50 +0100 Bo Berglund via lazarus wrote: >[...] > Suppose I make a package with about 10 non-GUI utility units and use > the Package Manager to compile them so they will be known to new > projects if I add a dependency to this package. > > Then in a new project I put a single one of the units into my uses > clause, will then the compile include just that unit Yes, that is the default. > or will it grab > all of the package content into the resulting binary? > > I hope that it will just compile the specified unit into the program > and not the complete package, but want to check this in case I am not > understanding how it works.... Mattias From jmlandmesser at gmx.de Fri Feb 17 22:41:45 2023 From: jmlandmesser at gmx.de (John Landmesser) Date: Fri, 17 Feb 2023 22:41:45 +0100 Subject: [Lazarus] Format an integer with thousandseparators by function format() Message-ID: <4e17de2a-8696-6ba1-9ef4-9cfa33c50f96@gmx.de> Hi, this one works, but i don't know why to devide the integer by 1: ??? fmt := '%.0n'; ??? s1 := Format(fmt,[MyInteger/*1*]); Lhelp tells me about function format, that does not work: > N > > Number format. This is the same as fixed point format, except that > thousand separators are inserted in the resulting string. > > Documentation generated on: Jun 27 2020 I'm on Lazarus 2.3.0 (rev main-2_3-2854-g0278edaea3) FPC 3.2.2 x86_64-linux-gtk2 Tipps are welcome John Landmesser -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at freepascal.org Fri Feb 17 23:13:32 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Fri, 17 Feb 2023 23:13:32 +0100 (CET) Subject: [Lazarus] Format an integer with thousandseparators by function format() In-Reply-To: <4e17de2a-8696-6ba1-9ef4-9cfa33c50f96@gmx.de> References: <4e17de2a-8696-6ba1-9ef4-9cfa33c50f96@gmx.de> Message-ID: On Fri, 17 Feb 2023, John Landmesser via lazarus wrote: > Hi, > > this one works, but i don't know why to devide the integer by 1: > > > ??? fmt := '%.0n'; > ??? s1 := Format(fmt,[MyInteger/*1*]); Because the result of the division is a float; not an integer. And %n will only format a float, not an integer. Michael. From russeld.lists at gmail.com Sun Feb 19 08:00:33 2023 From: russeld.lists at gmail.com (Russ) Date: Sun, 19 Feb 2023 09:00:33 +0200 Subject: [Lazarus] Canvas.TextRec aligns to canvas and not rectangle for tlTop and taLeftJustify. Message-ID: <227b12f4-39d7-a0a0-7c30-f7f239e14b52@gmail.com> Hi, When writing text to the canvas using Canvas.TextRec(), using layout tlTop and/or alignment? taLeftJustify, the text is aligned to the canvas left and top edges instead of those edges of the text rectangle. The other layout and alignment cases work correctly. The sample code below illustrates this for all 9 possible combinations of layout and alignment. Changing lines 1302 and 1304 of canvas.inc fixes this problem: ?? 1302:?? fRect.Left := X; --> fRect.Left := fRect.Left + X; ?? 1304:?? fRect.Top := Y;? --> fRect.Top := fRect.Top + Y; canvas.inc in Lazarus 2.2.4 and trunk are the same. Regards Russ ?? unit Unit1; ?? {$mode objfpc}{$H+} ?? interface ?? uses ???? Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls; ?? type ???? TForm1 = class(TForm) ?????? procedure FormCreate(Sender: TObject); ?????? procedure FormPaint(Sender: TObject); ???? end; ?? var ???? Form1: TForm1; ?? implementation ?? {$R *.lfm} ?? procedure TForm1.FormCreate(Sender: TObject); ?? begin ???? Width := 300; ???? Height := 300; ???? Position := poDesktopCenter; ?? end; ?? procedure TForm1.FormPaint(Sender: TObject); ?? const ???? Txt ='%s'+LineEnding+'%s'; ???? Spacing = 75; ???? LeftMargin = 50; ???? TopMargin = 50; ???? VAlign: array[0..2] of TTextLayout = (tlTop, tlCenter, tlBottom); ???? HAlign: array[0..2] of TAlignment = (taLeftJustify, taCenter, taRightJustify); ?? var ???? TxtRect: TRect;??? // Rectangle used for text. ???? Outline: TRect;??? // Enclosing outline rectangle. ???? TxtStyle: TTextStyle; ???? Col, Row: integer; ???? X, Y: Integer; ???? VStr, HStr: string; ?? begin ???? TxtStyle := Default(TTextStyle); ???? TxtStyle.Wordbreak := true; ???? TxtStyle.SystemFont := true; ???? TxtRect := TRect.Create(0, 0, 55, 50); ???? Outline := TRect.Create(0, 0, 59, 52); ???? for Row := 0 to 2 do begin ?????? TxtStyle.Layout := VAlign[Row]; ?????? WriteStr(VStr, VAlign[Row]); ?????? VStr := VStr.Replace('tl', ''); ?????? Y := TopMargin + Row * Spacing; ?????? for Col := 0 to 2 do begin ???????? WriteStr(HStr, HAlign[Col]); ???????? HStr := HStr.Replace('Justify','').Replace('ta',''); ???????? X := LeftMargin + Col * Spacing; ???????? Outline.SetLocation(X, Y); ???????? TxtRect.SetLocation(X, Y); ???????? TxtStyle.Alignment := HAlign[Col]; ???????? Canvas.Rectangle(Outline); ???????? Canvas.TextRect(TxtRect, 2, 2, Txt.Format(Txt, [VStr, HStr]), TxtStyle); ?????? end; ???? end; ?? end; ?? end.
?? object Form1: TForm1 ???? Left = 728 ???? Height = 529 ???? Top = 176 ???? Width = 545 ???? Caption = 'Form1' ???? OnCreate = FormCreate ???? OnPaint = FormPaint ???? LCLVersion = '2.2.4.0' ?? end
From jmlandmesser at gmx.de Sun Feb 19 11:18:58 2023 From: jmlandmesser at gmx.de (John Landmesser) Date: Sun, 19 Feb 2023 11:18:58 +0100 Subject: [Lazarus] Canvas.TextRec aligns to canvas and not rectangle for tlTop and taLeftJustify. In-Reply-To: <227b12f4-39d7-a0a0-7c30-f7f239e14b52@gmail.com> References: <227b12f4-39d7-a0a0-7c30-f7f239e14b52@gmail.com> Message-ID: <191717f1-9d89-46e3-ace9-b5636babfd0d@gmx.de> Hi, add information about lazarus and fpc Version plus OS you are running. Thats a bugreport? and should be written to https://gitlab.com/freepascal.org/ I confirm this bug for Lazarus 2.3.0 (rev main-2_3-2854-g0278edaea3) FPC 3.2.2 x86_64-linux-gtk2 see: https://i.imgur.com/oJw7tzf.png regards John Landmesser Am 19.02.23 um 08:00 schrieb Russ via lazarus: > Hi, > > When writing text to the canvas using Canvas.TextRec(), using layout > tlTop and/or alignment? taLeftJustify, the text is aligned to the > canvas left and top edges instead of those edges of the text > rectangle. The other layout and alignment cases work correctly. > > The sample code below illustrates this for all 9 possible combinations > of layout and alignment. > > Changing lines 1302 and 1304 of canvas.inc fixes this problem: > ?? 1302:?? fRect.Left := X; --> fRect.Left := fRect.Left + X; > ?? 1304:?? fRect.Top := Y;? --> fRect.Top := fRect.Top + Y; > > canvas.inc in Lazarus 2.2.4 and trunk are the same. > > Regards > Russ > > > ?? unit Unit1; > > ?? {$mode objfpc}{$H+} > > ?? interface > > ?? uses > ???? Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls; > > ?? type > ???? TForm1 = class(TForm) > ?????? procedure FormCreate(Sender: TObject); > ?????? procedure FormPaint(Sender: TObject); > ???? end; > > ?? var > ???? Form1: TForm1; > > ?? implementation > > ?? {$R *.lfm} > > ?? procedure TForm1.FormCreate(Sender: TObject); > ?? begin > ???? Width := 300; > ???? Height := 300; > ???? Position := poDesktopCenter; > ?? end; > > ?? procedure TForm1.FormPaint(Sender: TObject); > ?? const > ???? Txt ='%s'+LineEnding+'%s'; > ???? Spacing = 75; > ???? LeftMargin = 50; > ???? TopMargin = 50; > ???? VAlign: array[0..2] of TTextLayout = (tlTop, tlCenter, tlBottom); > ???? HAlign: array[0..2] of TAlignment = (taLeftJustify, taCenter, > taRightJustify); > ?? var > ???? TxtRect: TRect;??? // Rectangle used for text. > ???? Outline: TRect;??? // Enclosing outline rectangle. > ???? TxtStyle: TTextStyle; > ???? Col, Row: integer; > ???? X, Y: Integer; > ???? VStr, HStr: string; > ?? begin > ???? TxtStyle := Default(TTextStyle); > ???? TxtStyle.Wordbreak := true; > ???? TxtStyle.SystemFont := true; > > ???? TxtRect := TRect.Create(0, 0, 55, 50); > ???? Outline := TRect.Create(0, 0, 59, 52); > > ???? for Row := 0 to 2 do begin > ?????? TxtStyle.Layout := VAlign[Row]; > ?????? WriteStr(VStr, VAlign[Row]); > ?????? VStr := VStr.Replace('tl', ''); > ?????? Y := TopMargin + Row * Spacing; > > ?????? for Col := 0 to 2 do begin > ???????? WriteStr(HStr, HAlign[Col]); > ???????? HStr := HStr.Replace('Justify','').Replace('ta',''); > ???????? X := LeftMargin + Col * Spacing; > ???????? Outline.SetLocation(X, Y); > ???????? TxtRect.SetLocation(X, Y); > ???????? TxtStyle.Alignment := HAlign[Col]; > ???????? Canvas.Rectangle(Outline); > ???????? Canvas.TextRect(TxtRect, 2, 2, Txt.Format(Txt, [VStr, HStr]), > TxtStyle); > ?????? end; > ???? end; > ?? end; > > ?? end. > >
> ?? object Form1: TForm1 > ???? Left = 728 > ???? Height = 529 > ???? Top = 176 > ???? Width = 545 > ???? Caption = 'Form1' > ???? OnCreate = FormCreate > ???? OnPaint = FormPaint > ???? LCLVersion = '2.2.4.0' > ?? end >
From michael at freepascal.org Sun Feb 19 12:28:32 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 19 Feb 2023 12:28:32 +0100 (CET) Subject: [Lazarus] Folding ? Message-ID: Hi, Is it possible to enable/disable code folding on a per-language basis ? I would like to enable it only for HTML/XML and disable for all other languegs. (I'd add JSON, but there is no language JSON in the IDE ;), Currently it seems you can only do this by enabling code folding globally, and then disable it for all constructs in all languages except the ones you want... But it can be that I missed the option somewhere... Michael. From werner.pamler at freenet.de Sun Feb 19 12:39:51 2023 From: werner.pamler at freenet.de (Werner Pamler) Date: Sun, 19 Feb 2023 12:39:51 +0100 Subject: [Lazarus] Canvas.TextRec aligns to canvas and not rectangle for tlTop and taLeftJustify. In-Reply-To: <227b12f4-39d7-a0a0-7c30-f7f239e14b52@gmail.com> References: <227b12f4-39d7-a0a0-7c30-f7f239e14b52@gmail.com> Message-ID: <6ecd701c-29e3-e143-eb1c-5d50e4dafab6@freenet.de> Am 19.02.2023 um 08:00 schrieb Russ via lazarus: > When writing text to the canvas using Canvas.TextRec(), using layout > tlTop and/or alignment? taLeftJustify, the text is aligned to the > canvas left and top edges instead of those edges of the text > rectangle. The other layout and alignment cases work correctly. > > The sample code below illustrates this for all 9 possible combinations > of layout and alignment. > > Changing lines 1302 and 1304 of canvas.inc fixes this problem: > ?? 1302:?? fRect.Left := X; --> fRect.Left := fRect.Left + X; > ?? 1304:?? fRect.Top := Y;? --> fRect.Top := fRect.Top + Y; > > canvas.inc in Lazarus 2.2.4 and trunk are the same. Please don't change this - it will break numerous code. The reported behaviour is compatible with Delphi. What do you think are the additional x,y parameters good for? Delphi (and Lazarus) interprets them as the starting point of the text in the case where Layout is tlTop and Alignment is taLeftJustify, no matter what the Rect parameter is (which is used a clipping rectangle, though). God knows why x,y are not interpreted as an offset to the positions defined by Layout/Alignment directly. From ryansmithhe at gmail.com Sun Feb 19 12:43:10 2023 From: ryansmithhe at gmail.com (R.Smith) Date: Sun, 19 Feb 2023 13:43:10 +0200 Subject: [Lazarus] Canvas.TextRec aligns to canvas and not rectangle for tlTop and taLeftJustify. In-Reply-To: <6ecd701c-29e3-e143-eb1c-5d50e4dafab6@freenet.de> References: <227b12f4-39d7-a0a0-7c30-f7f239e14b52@gmail.com> <6ecd701c-29e3-e143-eb1c-5d50e4dafab6@freenet.de> Message-ID: On 2023/02/19 13:39, Werner Pamler via lazarus wrote: > > Please don't change this - it will break numerous code. > I agree with Werner, God knows why it's done that way, but it is, and changing it will surely break almost every application project I have. Please don't. From lazarus at mfriebe.de Sun Feb 19 14:00:35 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 19 Feb 2023 14:00:35 +0100 Subject: [Lazarus] Folding ? In-Reply-To: References: Message-ID: <06b2f913-208f-36f4-952e-02ea3c780175@mfriebe.de> On 19/02/2023 12:28, Michael Van Canneyt via lazarus wrote: > > Hi, > > Is it possible to enable/disable code folding on a per-language basis? ? No, or only in the way you described below. Or by changing the source in each highlighter, and make the pretend they don't fold. In any case, there also remains the "fold selected lines" folding. > > Currently it seems you can only do this by enabling code folding > globally, > and then disable it for all constructs in all languages except the > ones you > want... But it can be that I missed the option somewhere... From michael at freepascal.org Sun Feb 19 19:06:36 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 19 Feb 2023 19:06:36 +0100 (CET) Subject: [Lazarus] Folding ? In-Reply-To: <06b2f913-208f-36f4-952e-02ea3c780175@mfriebe.de> References: <06b2f913-208f-36f4-952e-02ea3c780175@mfriebe.de> Message-ID: On Sun, 19 Feb 2023, Martin Frb via lazarus wrote: > On 19/02/2023 12:28, Michael Van Canneyt via lazarus wrote: >> >> Hi, >> >> Is it possible to enable/disable code folding on a per-language basis? ? > No, or only in the way you described below. Or by changing the source in > each highlighter, and make the pretend they don't fold. That seems a strange way. Since folding can be globally switched on and off, it should also be possible to switch it on/off on a language basis. > > In any case, there also remains the "fold selected lines" folding. That would defeat the purpose. I use the folding to see if the HTML tags are closed properly without having to select them. Michael. From lazarus at mfriebe.de Sun Feb 19 20:31:12 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 19 Feb 2023 20:31:12 +0100 Subject: [Lazarus] Folding ? In-Reply-To: References: <06b2f913-208f-36f4-952e-02ea3c780175@mfriebe.de> Message-ID: <75d245fa-ee6d-4a66-767a-89e181d8c1e1@mfriebe.de> On 19/02/2023 19:06, Michael Van Canneyt wrote: > > > On Sun, 19 Feb 2023, Martin Frb via lazarus wrote: > >> On 19/02/2023 12:28, Michael Van Canneyt via lazarus wrote: >>> >>> Hi, >>> >>> Is it possible to enable/disable code folding on a per-language >>> basis? ? >> No, or only in the way you described below. Or by changing the source >> in each highlighter, and make the pretend they don't fold. > > That seems a strange way. Since folding can be globally switched on > and off, it should also be > possible to switch it on/off on a language basis. Well, it just hasn't been implemented. There is no reason not to add it, if someone wants to do it. To entertain my lack of imagination: What is the issue, if e.g. Pascal shows fold indicators, and you just don't use them? > >> >> In any case, there also remains the "fold selected lines" folding. > > That would defeat the purpose. I use the folding to see if the HTML > tags are closed properly without having > to select them. You don't have to select them. If you do select text, the gutter will show an additional fold (actually "hide") symbol, allowing you to collapse whatever text is selected. Btw, folding may not be the best way to check for correct html nesting. IIRC, the highlighter tries to find a matching-name closing tag, even if that means to skip other tags. From michael at freepascal.org Sun Feb 19 21:12:24 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 19 Feb 2023 21:12:24 +0100 (CET) Subject: [Lazarus] Folding ? In-Reply-To: <75d245fa-ee6d-4a66-767a-89e181d8c1e1@mfriebe.de> References: <06b2f913-208f-36f4-952e-02ea3c780175@mfriebe.de> <75d245fa-ee6d-4a66-767a-89e181d8c1e1@mfriebe.de> Message-ID: On Sun, 19 Feb 2023, Martin Frb wrote: > On 19/02/2023 19:06, Michael Van Canneyt wrote: >> >> >> On Sun, 19 Feb 2023, Martin Frb via lazarus wrote: >> >>> On 19/02/2023 12:28, Michael Van Canneyt via lazarus wrote: >>>> >>>> Hi, >>>> >>>> Is it possible to enable/disable code folding on a per-language basis? ? >>> No, or only in the way you described below. Or by changing the source in >>> each highlighter, and make the pretend they don't fold. >> >> That seems a strange way. Since folding can be globally switched on and >> off, it should also be >> possible to switch it on/off on a language basis. > > Well, it just hasn't been implemented. There is no reason not to add it, if > someone wants to do it. > > To entertain my lack of imagination: What is the issue, if e.g. Pascal shows > fold indicators, and you just don't use them? For starters, some people think adding {%region /fold} to the code is a good idea. I think not. Secondly, I sometimes inadvertently click on the fold markers. The above 2 reasons are why I disabled it. Also, I think that if you need folding in Pascal, your code is not very well structured. As a general rule, I think a procedure may not occupy more than 50 lines. If you adhere to that, folding is simply not needed. (strictly my personal opinion) >>> In any case, there also remains the "fold selected lines" folding. >> >> That would defeat the purpose. I use the folding to see if the HTML tags >> are closed properly without having >> to select them. > > You don't have to select them. > > If you do select text, the gutter will show an additional fold (actually > "hide") symbol, allowing you to collapse whatever text is selected. > > Btw, folding may not be the best way to check for correct html nesting. > IIRC, the highlighter tries to find a matching-name closing tag, even if that > means to skip other tags. No doubt. But there are other uses: in large html structures (HTML can be very verbose in some CSS frameworks, there is no way around it) , it helps to be able to see the larger structure. Ideally, the fold indicators are also not visible in HTML/XML, but I can simply right-click a div and ask to collapse/expand that div. Michael. From lazarus at mfriebe.de Sun Feb 19 21:49:23 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 19 Feb 2023 21:49:23 +0100 Subject: [Lazarus] Folding ? In-Reply-To: References: <06b2f913-208f-36f4-952e-02ea3c780175@mfriebe.de> <75d245fa-ee6d-4a66-767a-89e181d8c1e1@mfriebe.de> Message-ID: <3221c408-8add-8e16-2b1c-272806ff2f68@mfriebe.de> On 19/02/2023 21:12, Michael Van Canneyt wrote: > On Sun, 19 Feb 2023, Martin Frb wrote: > >> To entertain my lack of imagination: What is the issue, if e.g. >> Pascal shows fold indicators, and you just don't use them? > > Secondly, I sometimes inadvertently click on the fold markers. Ok, good reason. That the thing, a lot of features are tested against my own usage patterns / experience. Simply because I don't know other people usage patterns. I could imagine the accidental clicks to happen when trying to select text with the mouse (or set the caret). Neither of those 2 I usually do by mouse. > > The above 2 reasons are why I disabled it. Also, I think that if you need > folding in Pascal, your code is not very well structured. As a general > rule, > I think a procedure may not occupy more than 50 lines. If you adhere to > that, folding is simply not needed. Actually there used to be another reason for folding (but that has been mitigated a decade ago). And that other reason is why back then I spent the time to make it work... => Fold (several consecutive) entire procedures. I occasionally find it useful while writing code in one procedure, to have another procedure in view for reference. (E.g. refactoring, moving code around) If that was in the same unit (and back then one unit could only be open in one SourceEdit window), then I just folded all the procedures in between. Now, I just open the unit in 2 windows, and have them side by side. And in code that does have $IFDEF, it's sometimes nice to hide that. As well as comments, including single line comments (hence hide/fold). >> Btw, folding may not be the best way to check for correct html nesting. >> IIRC, the highlighter tries to find a matching-name closing tag, even >> if that means to skip other tags. > > No doubt. But there are other uses: in large html structures (HTML can be > very verbose in some CSS frameworks, there is no way around it) , it > helps to be able to see the larger structure. > > Ideally, the fold indicators are also not visible in HTML/XML, but I > can simply right-click a div and ask to collapse/expand that div. That could also be added. There are keyboard shortcuts to fold at word at cursor (if that word is starting a fold). Adding that to the menu should not be to hard. And neither should it be hard to add an option to hide the fold outline. But as usual it needs to be done. I don't mind feature requests for those. But it's likely some time before I would get to it. Hiding the fold-outline gutter (global / for all languages) is probably easy. So if folding by key works for you , and you don't mind that the keys work for pascal code too => that I can probably squeeze in. Or, if it is just against accidental clicks => go to "Mouse advanced options" Remove all (or at least left button) mouse actions for the fold-tree, and fold nodes. Then nothing happens if you click there. Or change the clicks, so they only work with a modifier key (as protection) On "Editor > Display" you can also change the "Gutter Separator index" from 3 to 4 => then the separator (a gray line /color can be changed) will be between the fold-tree and the text (and with that another 1 or 2 pixels distance / not much, but) (the preview in the options seems to be not showing the effect...) Btw, If the caret is at a html tag, the matching tag is highlighted, so you can see those without needing the gutter outline. From lazarus at mfriebe.de Sun Feb 19 22:13:57 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Sun, 19 Feb 2023 22:13:57 +0100 Subject: [Lazarus] Folding ? In-Reply-To: <3221c408-8add-8e16-2b1c-272806ff2f68@mfriebe.de> References: <06b2f913-208f-36f4-952e-02ea3c780175@mfriebe.de> <75d245fa-ee6d-4a66-767a-89e181d8c1e1@mfriebe.de> <3221c408-8add-8e16-2b1c-272806ff2f68@mfriebe.de> Message-ID: On 19/02/2023 21:49, Martin Frb via lazarus wrote: > > On "Editor > Display" you can also change the "Gutter Separator index" > from 3 to 4 => then the separator (a gray line /color can be changed) > will be between the fold-tree and the text (and with that another 1 or > 2 pixels distance / not much, but) > (the preview in the options seems to be not showing the effect...) There seems to be a bug. That needs an IDE restart (after changing the option) for the line to be painted... From michael at freepascal.org Mon Feb 20 12:31:15 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Mon, 20 Feb 2023 12:31:15 +0100 (CET) Subject: [Lazarus] Conditional Debugger breakpoints not working ? Message-ID: Hi, I'm trying to set a condition on a breakpoint. I have a local variable aUnit, type string: var aUnit : string; I wish the breakpoint is only triggered when aUnit equals 'termio'. So, in the breakpoint properties dialog, I enter the condition: aUnit='termio' It seems to have no effect whatsoever. The breakpoint is triggered always at the first traversal of the line. I tried variations (uppercase, lowercase) , but to no avail. Looking at the debug internals window, I see that the expression is only (correctly) evaluated by gdb when I move the mouse over the identifier in the sources: (gdb) &"ptype AUNIT\n" ~"type = ^Char\n" ^done (gdb) &"ptype AUNIT^\n" ~"type = Char\n" ^done (gdb) &"whatis AUNIT\n" ~"type = ANSISTRING\n" ^done (gdb) <-data-evaluate-expression AUNIT> ^done,value="0x7ffff7f73b18 'si_prc'" (gdb) So it can correctly evaluate the value aUnit. The question is, why is it ignoring my condition ? After some digging in the gdb output I find this: &"Error in testing breakpoint condition:\n" &"evaluation of this expression requires the program to have a function \"malloc\".\n" Hm. No mention of this in: https://wiki.lazarus.freepascal.org/Debugger_Setup https://wiki.lazarus.freepascal.org/IDE_Window:_Breakpoints#Breakpoint_properties OK, File under 'undocumented' and ignore for the time being, but I add cmem unit to my program. Seemingly, gdb now accepts the breakpoint condition: <-break-insert "\"/home/michael/domakefile.lpr\":161"> ^done,bkpt={number="7",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000401fe7",func="ADDRECIPE",file="domakefile.lpr",fullname="/home/michael/domakefile.lpr",line="161",thread-groups=["i1"],times="0",original-location="/home/michael/domakefile.lpr:161"} (gdb) <-break-condition 7 AUNIT="termio"> ^done (gdb) <-break-enable 7> ^done That makes it even worse: the breakpoint is simply never observed. If I do a poor man's conditional breakpoint: if (aUnit='termio') then Writeln('Aloha'); <-- set breakpoint on this line and run, I see that unit 'termio' is definitely encountered. So, "Houston, we have a problem..." Suggestions, things I maybe forgot ? Michael. From lazarus at mfriebe.de Mon Feb 20 12:39:48 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Mon, 20 Feb 2023 12:39:48 +0100 Subject: [Lazarus] Conditional Debugger breakpoints not working ? In-Reply-To: References: Message-ID: <7a52797d-917c-cfd0-9f9e-5e157aef35c2@mfriebe.de> On 20/02/2023 12:31, Michael Van Canneyt via lazarus wrote: > > I'm trying to set a condition on a breakpoint. > > I have a local variable aUnit, type string: > > var > ? aUnit : string; > > I wish the breakpoint is only triggered when aUnit equals 'termio'. > > So, in the breakpoint properties dialog, I enter the condition: > > aUnit='termio' > > It seems to have no effect whatsoever. The breakpoint is triggered > always at > the first traversal of the line. > > I tried variations (uppercase, lowercase) , but to no avail. > > Looking at the debug internals window, I see that the expression is > only (correctly) evaluated by gdb when I move the mouse over the > identifier > in the sources: > > (gdb) gdb doesn't know pascal strings, or how do an "=" operation on them. You can try to get? $_streq(myvar, "hello") to work.... https://sourceware.org/gdb/onlinedocs/gdb/Convenience-Funs.html Or use FpDebug. FpDebug can compare strings. From michael at freepascal.org Mon Feb 20 13:46:03 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Mon, 20 Feb 2023 13:46:03 +0100 (CET) Subject: [Lazarus] Conditional Debugger breakpoints not working ? In-Reply-To: <7a52797d-917c-cfd0-9f9e-5e157aef35c2@mfriebe.de> References: <7a52797d-917c-cfd0-9f9e-5e157aef35c2@mfriebe.de> Message-ID: On Mon, 20 Feb 2023, Martin Frb via lazarus wrote: > On 20/02/2023 12:31, Michael Van Canneyt via lazarus wrote: >> >> I'm trying to set a condition on a breakpoint. >> >> I have a local variable aUnit, type string: >> >> var >> ? aUnit : string; >> >> I wish the breakpoint is only triggered when aUnit equals 'termio'. >> >> So, in the breakpoint properties dialog, I enter the condition: >> >> aUnit='termio' >> >> It seems to have no effect whatsoever. The breakpoint is triggered >> always at >> the first traversal of the line. >> >> I tried variations (uppercase, lowercase) , but to no avail. >> >> Looking at the debug internals window, I see that the expression is >> only (correctly) evaluated by gdb when I move the mouse over the >> identifier >> in the sources: >> >> (gdb) > > gdb doesn't know pascal strings, or how do an "=" operation on them. > > You can try to get? $_streq(myvar, "hello") to work.... > https://sourceware.org/gdb/onlinedocs/gdb/Convenience-Funs.html > > Or use FpDebug. FpDebug can compare strings. I suggest you adapt the wiki to clarify all this. While you're at it, The link in the wiki page to the gdb convenience functions is broken. In general, I don't think you can expect the user to know that he should use $_streq(myvar, "hello"), specially the cmem condition that seems necessary. Ideally, the IDE could detect a string and transform the expression. Michael. From lazarus at mfriebe.de Mon Feb 20 15:02:58 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Mon, 20 Feb 2023 15:02:58 +0100 Subject: [Lazarus] Conditional Debugger breakpoints not working ? In-Reply-To: References: <7a52797d-917c-cfd0-9f9e-5e157aef35c2@mfriebe.de> Message-ID: <45d6cc97-dd32-1d12-ca9a-91d50622da1c@mfriebe.de> On 20/02/2023 13:46, Michael Van Canneyt via lazarus wrote: > > > I suggest you adapt the wiki to clarify all this. > > While you're at it, The link in the wiki page to the gdb convenience > functions is broken. updated > > In general, I don't think you can expect the user to know that he > should use $_streq(myvar, "hello"), specially the cmem condition that > seems necessary. > > Ideally, the IDE could detect a string and transform the expression. This always has been the issue with gdb. If you had a watch with anything but just a plain variable name, then gdb may give you: - an error, - or an incorrect result, - or the correct result For watches, there is quite a lot of code in the IDE to try and fix those things. There are testcases, that can be run with different debug-info, and diff gdb versions. (And they run for many hours / and unfortunately still have some errors, some false errors...). But there is no way to get to 100%. In many cases gdb simple does not give enough info to detect the necessary information on the underlaying type. (And when trying to get this, one has to be carefully not to crash gdb). Also it makes evaluating each individual watch a lot slower (at least factor 3 or 4). Though on that I have always pushed the point that a "correct result" is worth *any* wait time. In any case, with conditional breakpoints it would be even more complex.... It would be nice to have, but with the availability of FpDebug, it is very unlikely that will be fixed. (There are simply a lot of other things that (should) have more priority) I may add a warning to the breakpoint dlg, that for non-fpdebug will display a red TLabel below the input, with some text that the condition may not work at all. It is a problem on Mac, with LLDB. Though I am not even sure that conditional breakpoint are supported at all... LLDB probably can do them (with restrictions like gdb). But the IDE has absolutely on code to translate "pascal to lldb" => because for watches it can evaluate with fpdebug. But conditional breakpoints must be done by lldb, or they become very very slow. (That is if they need to pass lots of time before they match the condition, and each hit pass 1 second or more, you quickly get to several minutes of wait time) From michael at freepascal.org Mon Feb 20 15:14:01 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Mon, 20 Feb 2023 15:14:01 +0100 (CET) Subject: [Lazarus] Conditional Debugger breakpoints not working ? In-Reply-To: <45d6cc97-dd32-1d12-ca9a-91d50622da1c@mfriebe.de> References: <7a52797d-917c-cfd0-9f9e-5e157aef35c2@mfriebe.de> <45d6cc97-dd32-1d12-ca9a-91d50622da1c@mfriebe.de> Message-ID: On Mon, 20 Feb 2023, Martin Frb via lazarus wrote: > On 20/02/2023 13:46, Michael Van Canneyt via lazarus wrote: >> >> >> I suggest you adapt the wiki to clarify all this. >> >> While you're at it, The link in the wiki page to the gdb convenience >> functions is broken. > updated > >> >> In general, I don't think you can expect the user to know that he should >> use $_streq(myvar, "hello"), specially the cmem condition that seems >> necessary. >> >> Ideally, the IDE could detect a string and transform the expression. > > This always has been the issue with gdb. > > If you had a watch with anything but just a plain variable name, then gdb may > give you: > - an error, > - or an incorrect result, > - or the correct result > > For watches, there is quite a lot of code in the IDE to try and fix those > things. > There are testcases, that can be run with different debug-info, and diff gdb > versions. (And they run for many hours / and unfortunately still have some > errors, some false errors...). > > But there is no way to get to 100%. In many cases gdb simple does not give > enough info to detect the necessary information on the underlaying type. (And > when trying to get this, one has to be carefully not to crash gdb). > Also it makes evaluating each individual watch a lot slower (at least factor > 3 or 4). Though on that I have always pushed the point that a "correct > result" is worth *any* wait time. Yes. An incorrect result may result in infinite wait time :-) > > In any case, with conditional breakpoints it would be even more complex.... > > It would be nice to have, but with the availability of FpDebug, it is very > unlikely that will be fixed. (There are simply a lot of other things that > (should) have more priority) > > I may add a warning to the breakpoint dlg, that for non-fpdebug will display > a red TLabel below the input, with some text that the condition may not work > at all. I think this is a good idea. > > It is a problem on Mac, with LLDB. Though I am not even sure that conditional > breakpoint are supported at all... They are: https://stackoverflow.com/questions/37204551/lldb-setting-conditional-breakpoint-with-string-equality-as-condition > LLDB probably can do them (with restrictions like gdb). But the IDE has > absolutely on code to translate "pascal to lldb" => because for watches it > can evaluate with fpdebug. > But conditional breakpoints must be done by lldb, or they become very very > slow. (That is if they need to pass lots of time before they match the > condition, and each hit pass 1 second or more, you quickly get to several > minutes of wait time) No problem. I realize it is not easy to solve generally, although a solution for 'simple' strings would be welcome. I'll stick to poor man's conditionals. Then the compiler will tell me what I do wrong :) Michael. From bo.berglund at gmail.com Tue Feb 21 11:12:54 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 21 Feb 2023 11:12:54 +0100 Subject: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu References: <5c3f9688-c5b8-b208-e52d-82b361639a43@mfriebe.de> <0f863424-ea5e-300a-d03c-c65fb644d84d@mfriebe.de> Message-ID: <1v39vh5tolfii13dkqat1iut3014tfmv44@4ax.com> On Thu, 9 Feb 2023 22:37:20 +0100, Martin Frb via lazarus wrote: >On 09/02/2023 21:57, Bo Berglund via lazarus wrote: >> And it seems to be looking for $HOME/.config/fppkg.cfg even though I >> am using >> separate install dirs for Lazarus 2.0.12 and 2.2.4 and the launch file >> lazarus_2.2.4.desktop contains --pcp=/home/bosse/.lazarus_2.2.4 >> >> So I would expect the location of the fppkg.cnf file to be inside that pcp dir, >> but it is not. > >According to what I gathered info wise, fppkg only supports one config >dir. (it has some options, but not sure the IDE uses those) >So it does not work well for Lazarus multi install. This is just terrible! >From now on one has to view the error dialog every time one starts Lazarus? And nothing can be done about it? As I said I have used many Linux and Windows systems all with multiple installs of different versions of Lazarus and FPC and it has all worked well regarding launching the IDE. Never anything like this happened before. And the problem is not even on a single new install but on every install I do both using the Wiondows installer and building from sources. >The IDE will work fine without it. >It' only needed if you need some of the few packages that are only avail >via fppkg (though you can download them by hand anyway) I have never been aware of this before and it has just worked. I am not doing any fancy installs just first the basic installation and then use OLPM to install all of the extra packages I need (same list every time). Finally putting my own developed packages and utilities on each system as well. I have never even been aware of the fppkg program or its use. And with a new release I usually just make a parallel installation using pcp functionality. >>> Try to delete the old config by hand. >>> Then -outside the IDE - use the latest (3.2.2) fppkg to create a new >>> config. (may or may not need the fpc install in PATH) >> Exactly what do you suggest here? >> - Which old config? File name and location please. >The one in your home folder (I don't have Linux path)... >On Windows it's in %APPDATA%\Local\FreePascal\fppkg > >There are files like fppkg.cfg mirrors.xml packages.xml and some folders. > No other file found there than fppkg.cfg and if I reneme it and start fppkg.exe manually it recreates the exact same content in a new fppkg.cfg file. Still no effect on the actions on startup, error dislog pops up. >> - How do I use the new fpc to recreate it? I don't even know what it is.... >there is an fppkg utility in the fpc folder. (fppkg is part of fpc) On Linux it is found here: /home/bosse/bin/fppkg Notice that this is a global location for my user. And on my Windows install here: C:\Programs\Lazarus_2.2.4\fpc\3.2.2\bin\x86_64-win64\fppkg.exe This is a Lazarus unique location for ver 2.2.4 and on Windows it is not on path... Still both installations behave the same. > >If you just run it >fppkg >it should create a config file (if none exists). Yes it creates a new cnf file identical to the old renamed file. But still my new Lazarus won't start cleanly, whereas 2.0.12 starts just fine on Winddows as well as on Linux. No popup error message anywhere to be seen... >It is not about the lazarus version, but different fpc versions. >In my case (but maybe I was lucky) the older fpc didn't complain.... > I have used Lazarus since a long time, on my Windows 10 PC I have versions: 2.0.6, 2.0.8, 2.0.10, 2.0.12 and 2.2.4 All of these have their own fpc compiler installed with them in their own directory trees and it has worked just fine up until this newest version 2.2.4 broke it. And it does the same on both Linux and Windows!!! So it is definitely about the Lazarus version 2.2.4! I might try and put it on a Raspberry Pi4 just to check this... One that I have access to has 7 different Lazarus versions with the latest being 2.0.12 and FPC versions are 3.0.4 and 3.2.0 and it uses the pcp dir functionality to allow the multiple installs of different Lazarus versions. I will do this when I get the time later... -- Bo Berglund Developer in Sweden From luca at wetron.es Tue Feb 21 11:46:57 2023 From: luca at wetron.es (Luca Olivetti) Date: Tue, 21 Feb 2023 11:46:57 +0100 Subject: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu In-Reply-To: <1v39vh5tolfii13dkqat1iut3014tfmv44@4ax.com> References: <5c3f9688-c5b8-b208-e52d-82b361639a43@mfriebe.de> <0f863424-ea5e-300a-d03c-c65fb644d84d@mfriebe.de> <1v39vh5tolfii13dkqat1iut3014tfmv44@4ax.com> Message-ID: <1f37a5ab-c0cd-db8d-c121-a78686c9bbd4@wetron.es> El 21/2/23 a les 11:12, Bo Berglund via lazarus ha escrit: > So it is definitely about the Lazarus version 2.2.4! I know that this won't help you, but just for the record I have Lazarus 2.2.4 both under windows and linux and no popup on either. Both self compiled with fpc 3.2.2 (32 bits fpc from installer under windows, 64 bits fpc self compiled under linux). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From lazarus at mfriebe.de Tue Feb 21 13:14:20 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Tue, 21 Feb 2023 13:14:20 +0100 Subject: [Lazarus] Conditional Debugger breakpoints not working ? In-Reply-To: References: <7a52797d-917c-cfd0-9f9e-5e157aef35c2@mfriebe.de> <45d6cc97-dd32-1d12-ca9a-91d50622da1c@mfriebe.de> Message-ID: On 20/02/2023 15:14, Michael Van Canneyt via lazarus wrote: > > On Mon, 20 Feb 2023, Martin Frb via lazarus wrote: > >> >> It is a problem on Mac, with LLDB. Though I am not even sure that >> conditional breakpoint are supported at all... Just checked, conditions are set. But users must type them C-style. That is "a == 1". > > They are: > https://stackoverflow.com/questions/37204551/lldb-setting-conditional-breakpoint-with-string-equality-as-condition > That looks like it actually invokes strcmp() in the debugged exe. Which then depends on an fpc generated app having that function, and having sufficient debug info to have it found. The GDB $_streq on the other hand is an gdb intrinsic. From bo.berglund at gmail.com Tue Feb 21 13:48:19 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 21 Feb 2023 13:48:19 +0100 Subject: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu References: <5c3f9688-c5b8-b208-e52d-82b361639a43@mfriebe.de> <0f863424-ea5e-300a-d03c-c65fb644d84d@mfriebe.de> <1v39vh5tolfii13dkqat1iut3014tfmv44@4ax.com> <1f37a5ab-c0cd-db8d-c121-a78686c9bbd4@wetron.es> Message-ID: On Tue, 21 Feb 2023 11:46:57 +0100, Luca Olivetti via lazarus wrote: >El 21/2/23 a les 11:12, Bo Berglund via lazarus ha escrit: > >> So it is definitely about the Lazarus version 2.2.4! > > >I know that this won't help you, but just for the record I have Lazarus >2.2.4 both under windows and linux and no popup on either. >Both self compiled with fpc 3.2.2 (32 bits fpc from installer under >windows, 64 bits fpc self compiled under linux). > Now I have installed Lazarus 2.2.4 with fpc 3.2.2 on an RPi4B where I already had Lazarus 2.0.8 and fpc 3.0.4. The result is *exactly the same* as what I have described above: when I first start Lazarus 3.2.2 the customize dialog pops up where I have to configure various parts of the system: Lazarus: /home/pi/dev/lazarus/2.2.4/ Fpc: /home/pi/lib/fpc/3.2.2/ppcarm Fpc sources: /home/pi/dev/fpc/3.2.2 Make: /usr/bin/make Debugger: /usr/bin/gdb Fppkg: /home/pi/.config/fppkg.cfg (from the dropdown selector) The bottom pane shows this message: File: /home/pi/.config/fppkg.cfg Error: there is a problem with the Fppkg configuration. (Fppkg reports that the RTL is not installed.) You could try to restore the configuration files automatically, or adapt the configuration file manually. At this point I can start the IDE and it looks pretty much normal. Close Lazarus and open it again and I am back at the Config dialog with a stated error about the Fppkg item. My procedure for installing is this: 1. Build freepascal: -------------------- Install various dependencies first: sudo apt install -y libx11-dev libgdk-pixbuf2.0-dev libcairo2-dev gir1.2-coglpango-1.0 libpangox-1.0-dev xorg-dev libgtk2.0-dev libpango1.0-dev sudo apt install -y freetds-dev gdb copy ppcarm version 3.2.0 from another RPi to $HOME/dev/fpc Then: cd $HOME/dev/fpc wget https://gitlab.com/freepascal.org/fpc/source/-/archive/release_3_2_2/source-release_3_2_2.tar.gz tar -xvf source-release_3_2_2.tar.gz mv source-release_3_2_2 3.2.2 cd 3.2.2 make clean FPC="$HOME/dev/fpc/ppcarm" make all FPC="$HOME/dev/fpc/ppcarm" make install PREFIX="$HOME" FPC="$HOME/dev/fpc/3.2.2/compiler/ppcarm" rm "$HOME/bin/ppcarm" ln -sf "$HOME/lib/fpc/3.2.2/ppcarm" "$HOME/bin/ppcarm" make sourceinstall PREFIX="$HOME" FPC="$HOME/bin/ppcarm" $HOME/lib/fpc/3.2.2/samplecfg $HOME/lib/fpc/3.2.2 $HOME mv "$HOME/fpc.cfg" "$HOME/.fpc.cfg" 2. Build Lazarus ---------------- cd $HOME/dev/lazarus wget https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/lazarus_2_2_4/lazarus-lazarus_2_2_4.tar.gz tar xvf lazarus-lazarus_2_2_4.tar.gz mv lazarus-lazarus_2_2_4 2.2.4 cd 2.2.4 make clean time make bigide strip -s lazarus mkdir -p $HOME/.lazarus_2.2.4 3. Create desktop file to launch Lazarus: ----------------------------------------- nano $HOME/.local/share/applications/lazarus_2.2.4.desktop Add this to the file: [Desktop Entry] Comment=Lazarus IDE 2.2.4 Terminal=false Name=Lazarus 2.2.4 Exec=/home/pi/dev/lazarus/2.2.4/startlazarus --pcp=/home/pi/.lazarus_2.2.4 %f Type=Application Icon=/home/pi/dev/lazarus/2.2.4/images/ide_icon48x48.png Categories=Application;IDE;Development;GTK;GUIDesigner;Programming; NoDisplay=false Keywords=editor;Pascal;IDE;FreePascal;fpc;Design;Designer; At this point the start menu "Programming" submenu contains the "Lazarus 2.2.4" item and Lazarus can be launched. Any ideas what has gone wrong? And please note that unlike on Linux (source install as above) I have installed Lazarus 2.2.4 on Windows using the official installer from SourceForge and the exact same thing happens... -- Bo Berglund Developer in Sweden From luca at wetron.es Tue Feb 21 14:04:09 2023 From: luca at wetron.es (Luca Olivetti) Date: Tue, 21 Feb 2023 14:04:09 +0100 Subject: [Lazarus] Fppkg reports RTL not installed - Lazarus 2.2.4/fpc 3.2.2 from sources on Ubuntu In-Reply-To: References: <5c3f9688-c5b8-b208-e52d-82b361639a43@mfriebe.de> <0f863424-ea5e-300a-d03c-c65fb644d84d@mfriebe.de> <1v39vh5tolfii13dkqat1iut3014tfmv44@4ax.com> <1f37a5ab-c0cd-db8d-c121-a78686c9bbd4@wetron.es> Message-ID: <4c3cea17-0c62-01df-484f-293277e7d5ff@wetron.es> El 21/2/23 a les 13:48, Bo Berglund via lazarus ha escrit: > Any ideas what has gone wrong? no idea really, I'm not familiar with fppkg. I can only say that in lazarus my "fppkg configuration file" setting is empty, if I invoke "fppkg list" from the command line it works both under windows and linux, though under linux it shows that the installed rtl is 3.2.0 (even if I'm using fpc 3.2.2). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From bo.berglund at gmail.com Tue Feb 21 19:18:28 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 21 Feb 2023 19:18:28 +0100 Subject: [Lazarus] Screwed up Lazarus installation - how to make clean and start over? Message-ID: I was trying to nail down the reason for the fppkg errors on start of Lazarus 2.2.4. I had the install running fine except for the Config screen showing up on every start of Lazarus with an error message about fppkg... So I proceeded to install my usual set of packages from OLPM, but when I had selected the set I usually install and it was done and asked about rebuilding Lazarus it did so and at the end closed itself and did not re-appear! Now I cannot start Lazarus at all.... I tried to move the pcp dir away but it did not work either and starting with an empty pcp dir does also not work. So I tried to start over by going to the Lazarus dir and issue make clean, but that did also not work: ~/dev/lazarus/2.2.4 $ make clean Makefile:234: *** The Makefile doesn't support target can't-executed,, please run fpcmake first. Stop. What would be the correct procedure now to start over? -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Wed Feb 22 10:00:01 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 22 Feb 2023 10:00:01 +0100 Subject: [Lazarus] Lazarus and FreePascal version relations on Linux and Windows? Message-ID: <4glbvh9fan5qflnsvp2qf2vdodibdugq0t@4ax.com> I have used Lazarus on Windows and Linux many years and I have built the Linux versions from sources but used the official installer for Windows. On Linux I have had parallel versions of Lazarus but usually the same FPC and this has worked fine. I think that on Linux the FPC becomes a global version and then new Lazarus gets confused... On Windows the installer separates the complete package into a separate directory which contains both Lazarus and FPC and none is put on system path. So when I have say 6 different versions of Lazarus on Windows they are all separate and do not conflict with each other. Now I am having problems installing Lazarus 2.2.4 on Linux systems where older Lazarus version exist because they use an older FPC which the new Lazarus cannot use (3.0.4 vs 3.2.2). On Linux FPC is put on path and so the instant one installs 3.2.2 on a system already using 3.0.4 disaster follows... Is this the reason for the continued problems with fppkg? And another question: How can I force Lazarus to show the initial configuration page, which is shown on the very first start after installing Lazarus and later is skipped? I think I remember that there is a way to show it from within Lazarus but I cannot find where now... Either way I would like to look at the config page for a working system so I can see the differences between that and a Lazarus that behaves bad. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Wed Feb 22 10:43:35 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 22 Feb 2023 10:43:35 +0100 Subject: [Lazarus] Screwed up Lazarus installation - how to make clean and start over? References: Message-ID: On Tue, 21 Feb 2023 19:18:28 +0100, Bo Berglund via lazarus wrote: >I was trying to nail down the reason for the fppkg errors on start of Lazarus >2.2.4. >I had the install running fine except for the Config screen showing up on every >start of Lazarus with an error message about fppkg... > >So I proceeded to install my usual set of packages from OLPM, but when I had >selected the set I usually install and it was done and asked about rebuilding >Lazarus it did so and at the end closed itself and did not re-appear! >Now I cannot start Lazarus at all.... > >I tried to move the pcp dir away but it did not work either and starting with an >empty pcp dir does also not work. > >So I tried to start over by going to the Lazarus dir and issue make clean, but >that did also not work: > >~/dev/lazarus/2.2.4 $ make clean >Makefile:234: *** The Makefile doesn't support target can't-executed,, please >run fpcmake first. Stop. > >What would be the correct procedure now to start over? Lacking any advice here I started over by removing the old Lazarus directory and the pcp dir and then build from start with a new set of source files in a fresh 2.2.4 subdir... All was Ok until again the OLPM packages were installed when the new Lazarus also failed to start. It seems like at least one of the packages I use from OLPM will hose Lazarus! So now I will repeat the effort but this time I will install one package after another using OLPM and rebuild Lazarus IDE after each. This way I would be able to pinpoint the one that causes the problem. Finally: -------- I have looked at https://wiki.freepascal.org/lazbuild and want to know: Is there a way to specify the compiler *path* to use for lazbuild? For example (on one line): lazbuild --build-ide= --pcp=$HOME/.lazarus_2.2.4 --compiler=$HOME/lib/fpc/3.2.2/ppcarm According to the wiki it is unclear to me if a path can be used rather than only the file name (in which case it needs to be on path?)... -- Bo Berglund Developer in Sweden From jmlandmesser at gmx.de Wed Feb 22 10:44:03 2023 From: jmlandmesser at gmx.de (John Landmesser) Date: Wed, 22 Feb 2023 10:44:03 +0100 Subject: [Lazarus] Lazarus and FreePascal version relations on Linux and Windows? In-Reply-To: <4glbvh9fan5qflnsvp2qf2vdodibdugq0t@4ax.com> References: <4glbvh9fan5qflnsvp2qf2vdodibdugq0t@4ax.com> Message-ID: <39844bd8-66b1-21fd-b375-bf075e0743e2@gmx.de> Am 22.02.23 um 10:00 schrieb Bo Berglund via lazarus: > I have used Lazarus on Windows and Linux many years and I have built the Linux > versions from sources but used the official installer for Windows. > > On Linux I have had parallel versions of Lazarus but usually the same FPC and > this has worked fine. I think that on Linux the FPC becomes a global version and > then new Lazarus gets confused... * * *Which fpc is needed tells you the release notes ... that changes sometimes!* > > On Windows the installer separates the complete package into a separate > directory which contains both Lazarus and FPC and none is put on system path. > So when I have say 6 different versions of Lazarus on Windows they are all > separate and do not conflict with each other. > > Now I am having problems installing Lazarus 2.2.4 on Linux systems where older > Lazarus version exist because they use an older FPC which the new Lazarus cannot > use (3.0.4 vs 3.2.2). > > On Linux FPC is put on path and so the instant one installs 3.2.2 on a system > already using 3.0.4 disaster follows... > > Is this the reason for the continued problems with fppkg? > > And another question: > > How can I force Lazarus to show the initial configuration page, which is shown > on the very first start after installing Lazarus and later is skipped? * * *That is in terminal lazarus --setup* > I think I remember that there is a way to show it from within Lazarus but I > cannot find where now... > > Either way I would like to look at the config page for a working system so I can > see the differences between that and a Lazarus that behaves bad. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Wed Feb 22 11:11:38 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Wed, 22 Feb 2023 11:11:38 +0100 Subject: [Lazarus] Lazarus and FreePascal version relations on Linux and Windows? In-Reply-To: <4glbvh9fan5qflnsvp2qf2vdodibdugq0t@4ax.com> References: <4glbvh9fan5qflnsvp2qf2vdodibdugq0t@4ax.com> Message-ID: <5dfa9bb3-645a-a48d-6939-dbf367dde469@mfriebe.de> On 22/02/2023 10:00, Bo Berglund via lazarus wrote: > Now I am having problems installing Lazarus 2.2.4 on Linux systems where older > Lazarus version exist because they use an older FPC which the new Lazarus cannot > use (3.0.4 vs 3.2.2). You can install several fpc on Linux. ** But you need to remove the global /etc/fpc.cfg and have it local to the install. ** You can look at the output of ??? fpc -va? empty_project.pas | grep fpc.cfg to find the locations were fpc looks for it. There may also be a way (I don't know) to have the IDE pass a param to fpc telling fpc which fpc.cfg to use.... And you either need to start the IDE via a script, setting a suitable %PATH env, so the correct fpc can be found. And fpc can find the correct ppc. Or if you don't cross compile, you can invoke ppc directly . I use the below. It allows several builds, even of the same version (debug / opt) #!/bin/sh mkdir -p /home/m/fpc/$INSTSRC mkdir -p /home/m/fpc/$INSTSRC/source cd /home/m/fpc/$INSTSRC/source git -C? /home/m/fpc/svn/source --work-tree=/home/m/fpc/$INSTSRC/source restore . ### have a full working fpc in path to start the build mkdir -p /home/m/fpc/$INSTPATH/ mkdir -p /home/m/fpc/$INSTPATH/def cd /home/m/fpc/$INSTSRC/source make clean make all? OPT="-g- -gl -O-2? " make install INSTALL_PREFIX=/home/m/fpc/$INSTPATH/def mkdir -p /home/m/fpc/$INSTPATH/def/lib/fpc/etc mkdir -p /home/m/fpc/$INSTPATH/def/etc cd /home/m/fpc/$INSTPATH def/bin/fpcmkcfg -d basepath=/home/m/fpc/$INSTPATH/def/lib/fpc/$INSTVERS > def/lib/fpc/etc/fpc.cfg def/bin/fpcmkcfg -d basepath=/home/m/fpc/$INSTPATH/def/lib/fpc/$INSTVERS > def/etc/fpc.cfg ln -s /home/m/fpc/$INSTPATH/def/lib/fpc/$INSTVERS/ppcx64 /home/m/fpc/$INSTPATH/def/bin/ppcx64 ## use in the IDE /home/m/fpc/$INSTPATH/def/lib/fpc/$INSTVERS/ppcx64 > And another question: > > How can I force Lazarus to show the initial configuration page, which is shown > on the very first start after installing Lazarus and later is skipped? lazarus --setup In the git main version of lazarus you can also force certain checks to be skipped (including fppkg) lazarus --help --skip-checks=LazarusDir,FpcExe,FpcSrc,Make,Debbugger,Fppkg,Setup,MissingPackageFile,InstallDir,SingleInstance,All ????????????????????? Skip selected checks at startup. You can put those into the ? lazarus.cfg file (in the same directory as your lazarus exe // or your startlazarus exe, in case you use that and your lazarus is it the primary conf path) From michael at freepascal.org Wed Feb 22 11:18:10 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Wed, 22 Feb 2023 11:18:10 +0100 (CET) Subject: [Lazarus] Lazarus and FreePascal version relations on Linux and Windows? In-Reply-To: <4glbvh9fan5qflnsvp2qf2vdodibdugq0t@4ax.com> References: <4glbvh9fan5qflnsvp2qf2vdodibdugq0t@4ax.com> Message-ID: On Wed, 22 Feb 2023, Bo Berglund via lazarus wrote: > I have used Lazarus on Windows and Linux many years and I have built the Linux > versions from sources but used the official installer for Windows. > > On Linux I have had parallel versions of Lazarus but usually the same FPC and > this has worked fine. I think that on Linux the FPC becomes a global version and > then new Lazarus gets confused... > > On Windows the installer separates the complete package into a separate > directory which contains both Lazarus and FPC and none is put on system path. > So when I have say 6 different versions of Lazarus on Windows they are all > separate and do not conflict with each other. > > Now I am having problems installing Lazarus 2.2.4 on Linux systems where older > Lazarus version exist because they use an older FPC which the new Lazarus cannot > use (3.0.4 vs 3.2.2). > > On Linux FPC is put on path and so the instant one installs 3.2.2 on a system > already using 3.0.4 disaster follows... On my home PC, I have 16 FPC versions installed, and 4 or 5 different lazarus systems. (in fact, a single lazarus installation, just with different --pcp options) Yet I experience none of the problems that you experience. The only thing that is different from a default setup is that I make symlinks /usr/local/bin/ppcx64-3.2.2 -> /usr/local/lib/fpc/3.2.2/ppcx64 (similar for the other tools) A lazarus install always refers to a versioned ppc/fpc tool. What we could possibly do is to install fpc with the version numbers suffixed, and an extra symlink to the current version without suffix. This way, when you install a newer version, the old version is still available. Michael. From bo.berglund at gmail.com Wed Feb 22 18:01:13 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 22 Feb 2023 18:01:13 +0100 Subject: [Lazarus] Screwed up Lazarus installation - how to make clean and start over? References: Message-ID: On Wed, 22 Feb 2023 10:43:35 +0100, Bo Berglund via lazarus wrote: >Lacking any advice here I started over by removing the old Lazarus directory and >the pcp dir and then build from start with a new set of source files in a fresh >2.2.4 subdir... > >All was Ok until again the OLPM packages were installed when the new Lazarus >also failed to start. It seems like at least one of the packages I use from OLPM >will hose Lazarus! > >So now I will repeat the effort but this time I will install one package after >another using OLPM and rebuild Lazarus IDE after each. This way I would be able >to pinpoint the one that causes the problem. So now I have found a package in OnLinePackageManager that will hose Lazarus if installed: BGRABitmap Up until installing that I was fine, but now Lazarus won't start.... The Initial image is shown for 3 seconds and then disappears. Then nothing... What can I do to get into Lazarus and remove the BGRABitmap? Or is there somewhere a file or such I can edit and then rebuild the IDE from the command line? This is on Linux (Raspberry Pi OS). -- Bo Berglund Developer in Sweden From lazarus at kluug.net Wed Feb 22 18:05:25 2023 From: lazarus at kluug.net (Ondrej Pokorny) Date: Wed, 22 Feb 2023 18:05:25 +0100 Subject: [Lazarus] Screwed up Lazarus installation - how to make clean and start over? In-Reply-To: References: Message-ID: <27f0bdb2-4d2f-6fcc-599f-4e12f6cd9cdd@kluug.net> On 22.02.2023 18:01, Bo Berglund via lazarus wrote: > On Wed, 22 Feb 2023 10:43:35 +0100, Bo Berglund via lazarus > wrote: > >> Lacking any advice here I started over by removing the old Lazarus directory and >> the pcp dir and then build from start with a new set of source files in a fresh >> 2.2.4 subdir... >> >> All was Ok until again the OLPM packages were installed when the new Lazarus >> also failed to start. It seems like at least one of the packages I use from OLPM >> will hose Lazarus! >> >> So now I will repeat the effort but this time I will install one package after >> another using OLPM and rebuild Lazarus IDE after each. This way I would be able >> to pinpoint the one that causes the problem. > So now I have found a package in OnLinePackageManager that will hose Lazarus if > installed: > BGRABitmap > > Up until installing that I was fine, but now Lazarus won't start.... > > The Initial image is shown for 3 seconds and then disappears. > Then nothing... > > What can I do to get into Lazarus and remove the BGRABitmap? > > Or is there somewhere a file or such I can edit and then rebuild the IDE from > the command line? > > This is on Linux (Raspberry Pi OS). Usually there is an "old" Lazarus executable (lazarus.old) next to the Lazarus executable. I usually switch to that if something is wrong with the new one. A problem arises if the old exe doesn't work either because it has been overwritten etc. Try it, that might be the quickest help. Ondrej From jmlandmesser at gmx.de Wed Feb 22 18:43:13 2023 From: jmlandmesser at gmx.de (John Landmesser) Date: Wed, 22 Feb 2023 18:43:13 +0100 Subject: [Lazarus] Screwed up Lazarus installation - how to make clean and start over? In-Reply-To: References: Message-ID: Am 22.02.23 um 18:01 schrieb Bo Berglund via lazarus: > On Wed, 22 Feb 2023 10:43:35 +0100, Bo Berglund via lazarus > wrote: > >> Lacking any advice here I started over by removing the old Lazarus directory and >> the pcp dir and then build from start with a new set of source files in a fresh >> 2.2.4 subdir... >> >> All was Ok until again the OLPM packages were installed when the new Lazarus >> also failed to start. It seems like at least one of the packages I use from OLPM >> will hose Lazarus! >> >> So now I will repeat the effort but this time I will install one package after >> another using OLPM and rebuild Lazarus IDE after each. This way I would be able >> to pinpoint the one that causes the problem. > So now I have found a package in OnLinePackageManager that will hose Lazarus if > installed: > BGRABitmap *I could install this package on my:* *Lazarus 2.3.0 (rev main-2_3-2873-g17b66f88c4) FPC 3.2.2 x86_64-linux-gtk2* *Linux manjaro 6.1.12-1-MANJARO #1 SMP PREEMPT_DYNAMIC Tue Feb 14 21:59:10 UTC 2023 x86_64 GNU/Linux * * * *Perhaps start lazarus from terminal to see what its telling ?!* > > Up until installing that I was fine, but now Lazarus won't start.... > > The Initial image is shown for 3 seconds and then disappears. > Then nothing... > > What can I do to get into Lazarus and remove the BGRABitmap? > > Or is there somewhere a file or such I can edit and then rebuild the IDE from > the command line? > > This is on Linux (Raspberry Pi OS). > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Wed Feb 22 21:15:00 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 22 Feb 2023 21:15:00 +0100 Subject: [Lazarus] Screwed up Lazarus installation - how to make clean and start over? References: <27f0bdb2-4d2f-6fcc-599f-4e12f6cd9cdd@kluug.net> Message-ID: <1htcvhd4mtjl3i1j7c7t675k4unnpl9534@4ax.com> On Wed, 22 Feb 2023 18:05:25 +0100, Ondrej Pokorny via lazarus wrote: >On 22.02.2023 18:01, Bo Berglund via lazarus wrote: >> So now I have found a package in OnLinePackageManager that will hose Lazarus if >> installed: >> BGRABitmap >> >> Up until installing that I was fine, but now Lazarus won't start.... >> >> The Initial image is shown for 3 seconds and then disappears. >> Then nothing... >> >> What can I do to get into Lazarus and remove the BGRABitmap? >> >> Or is there somewhere a file or such I can edit and then rebuild the IDE from >> the command line? >> >> This is on Linux (Raspberry Pi OS). > >Usually there is an "old" Lazarus executable (lazarus.old) next to the >Lazarus executable. I usually switch to that if something is wrong with >the new one. A problem arises if the old exe doesn't work either because >it has been overwritten etc. Try it, that might be the quickest help. > Thanks Ondrej! I had no idea such a 1-level backup existed! Now running that older version but with a partially installed package... bglcontrols.lpk is not installed but bgrabitmappack.lpk is. So the whole thing is partially installed. How can I *remove it totally* such that it is not existing at all in my system? I don't want this component to reinstall when I add another package and rebuild Lazarus. Note: I did the same OLPM install on a Linux Mint (PC platform) and there the whole package was installed just fine. No crash on that CPU. -- Bo Berglund Developer in Sweden From mgr.janusz.chmiel at gmail.com Wed Feb 22 22:30:46 2023 From: mgr.janusz.chmiel at gmail.com (Mgr. Janusz Chmiel) Date: Wed, 22 Feb 2023 22:30:46 +0100 Subject: [Lazarus] rapid apps development for fpcjvm android Message-ID: An HTML attachment was scrubbed... URL: From mgr.janusz.chmiel at gmail.com Wed Feb 22 22:30:46 2023 From: mgr.janusz.chmiel at gmail.com (Mgr. Janusz Chmiel) Date: Wed, 22 Feb 2023 22:30:46 +0100 Subject: [Lazarus] rapid apps development for fpcjvm android Message-ID: An HTML attachment was scrubbed... URL: From werner.pamler at freenet.de Wed Feb 22 22:59:15 2023 From: werner.pamler at freenet.de (Werner Pamler) Date: Wed, 22 Feb 2023 22:59:15 +0100 Subject: [Lazarus] Screwed up Lazarus installation - how to make clean and start over? In-Reply-To: <1htcvhd4mtjl3i1j7c7t675k4unnpl9534@4ax.com> References: <27f0bdb2-4d2f-6fcc-599f-4e12f6cd9cdd@kluug.net> <1htcvhd4mtjl3i1j7c7t675k4unnpl9534@4ax.com> Message-ID: <6d2c9977-84a1-082e-342c-f8e0728a4631@freenet.de> Am 22.02.2023 um 21:15 schrieb Bo Berglund via lazarus: > Now running that older version but with a partially installed package... > bglcontrols.lpk is not installed but bgrabitmappack.lpk is. So the whole thing > is partially installed. > > How can I *remove it totally* such that it is not existing at all in my system? > I don't want this component to reinstall when I add another package and rebuild > Lazarus. You uninstall a package in the "Package" > "Install/Uninstall packages" dialog. Select the package to be removed in the left list, click "Uninstall selection" and then "Save and Rebuild IDE". This will remove bglcontrols which is a runtime/designtime package, but it will not remove bgrabitmappack - it is a runtime package and thus is not compiled into the IDE. This cannot crash the compilation of the IDE. If you also want to get rid of it, go to "Package" > "Package Links", find it in the list, check it and click "Delete selected". This removes the path to the package from an internal list so that the IDE no longer knows where the package is (the files are still there, though - but you can delete them manually in the OS). From mgr.janusz.chmiel at gmail.com Wed Feb 22 22:30:46 2023 From: mgr.janusz.chmiel at gmail.com (Mgr. Janusz Chmiel) Date: Wed, 22 Feb 2023 22:30:46 +0100 Subject: [Lazarus] rapid apps development for fpcjvm android Message-ID: An HTML attachment was scrubbed... URL: From luca at wetron.es Thu Feb 23 09:04:51 2023 From: luca at wetron.es (Luca Olivetti) Date: Thu, 23 Feb 2023 09:04:51 +0100 Subject: [Lazarus] db grid/dataset components that only load currently visible records? Message-ID: Hello, do you know of any component/dataset combo that works like a TDBGrid but doesn't load all the records from the db when doing a refresh, just the ones that are currently visible, yet offering seamless scrolling? I looked in the wiki but I couldn't find any. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From luca at wetron.es Thu Feb 23 09:10:31 2023 From: luca at wetron.es (Luca Olivetti) Date: Thu, 23 Feb 2023 09:10:31 +0100 Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: References: Message-ID: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> El 23/2/23 a les 9:04, Luca Olivetti via lazarus ha escrit: > Hello, > > do you know of any component/dataset combo that works like a TDBGrid but > doesn't load all the records from the db when doing a refresh, just the > ones that are currently visible, yet offering seamless scrolling? > I looked in the wiki but I couldn't find any. Something like this: https://docwiki.embarcadero.com/RADStudio/Rio/en/Browsing_Tables_(FireDAC)#Live_Data_Window_Mode Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From michael at freepascal.org Thu Feb 23 09:43:47 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 23 Feb 2023 09:43:47 +0100 (CET) Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> Message-ID: On Thu, 23 Feb 2023, Luca Olivetti via lazarus wrote: > El 23/2/23 a les 9:04, Luca Olivetti via lazarus ha escrit: >> Hello, >> >> do you know of any component/dataset combo that works like a TDBGrid but >> doesn't load all the records from the db when doing a refresh, just the >> ones that are currently visible, yet offering seamless scrolling? >> I looked in the wiki but I couldn't find any. > > Something like this: > > https://docwiki.embarcadero.com/RADStudio/Rio/en/Browsing_Tables_(FireDAC)#Live_Data_Window_Mode This is not something that the grid handles. This is a dataset feature. At this moment I know of no FPC/Lazarus dataset component that handles this automatically. Note the remark on that page: "Although FireDAC minimizes the number of generated and executed SQL commands in LDW mode, it still produces a heavier DB load than TFDQuery. So, application developers should carefully choose when to use TFDTable and LDW mode. " This is exactly why FPC does not have a database table component. It's horribly inefficient. Michael. From jean.suzineau at wanadoo.fr Thu Feb 23 10:24:05 2023 From: jean.suzineau at wanadoo.fr (Jean SUZINEAU) Date: Thu, 23 Feb 2023 10:24:05 +0100 Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: References: Message-ID: <4a8f08ef-a747-ba37-b766-a33fbcb641f4@wanadoo.fr> May be making a custom component based on VirtualTreeView ? From octopushole at gmail.com Thu Feb 23 10:55:56 2023 From: octopushole at gmail.com (duilio foschi) Date: Thu, 23 Feb 2023 10:55:56 +0100 Subject: [Lazarus] TFPHTTPServer Message-ID: I wrote a simple server using TFPHTTPServer. All incoming calls are processed using procedure HandleRequest(var ARequest: TFPHTTPConnectionRequest; var AResponse: TFPHTTPConnectionResponse); My first tests were ok and encouraging but... how do I know if the call was a GET or a POST? I guess that ARequest "knows" it, but I cannot find a way to ask :) Thank you Peppe Polpo From luca at wetron.es Thu Feb 23 11:02:51 2023 From: luca at wetron.es (Luca Olivetti) Date: Thu, 23 Feb 2023 11:02:51 +0100 Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> Message-ID: <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> El 23/2/23 a les 9:43, Michael Van Canneyt via lazarus ha escrit: > >> >> Something like this: >> >> https://docwiki.embarcadero.com/RADStudio/Rio/en/Browsing_Tables_(FireDAC)#Live_Data_Window_Mode > > This is not something that the grid handles. This is a dataset feature. Yes, I supposed so > > At this moment I know of no FPC/Lazarus dataset component that handles > this automatically. bummer :-( > Note the remark on that page: > > "Although FireDAC minimizes the number of generated and executed SQL > commands in LDW mode, > ?it still produces a heavier DB load than TFDQuery. So, application > developers should > ?carefully choose when to use TFDTable and LDW mode. " > > This is exactly why FPC does not have a database table component. It's > horribly inefficient. OTOH a TDBGrid is a very convenient way to display data. I my application I just use it to display (in read-only mode) an sqlite table that holds less than 1000 records and it could be updated quite frequently (hence the need for the frequent TDataset.refresh), and it works fast enough with that limited amount of records. Now I need to expand the table to 10000 records and the performance is unacceptable. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From michael at freepascal.org Thu Feb 23 11:07:52 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 23 Feb 2023 11:07:52 +0100 (CET) Subject: [Lazarus] TFPHTTPServer In-Reply-To: References: Message-ID: On Thu, 23 Feb 2023, duilio foschi via lazarus wrote: > I wrote a simple server using TFPHTTPServer. > > All incoming calls are processed using > procedure HandleRequest(var ARequest: TFPHTTPConnectionRequest; > var AResponse: TFPHTTPConnectionResponse); > > My first tests were ok and encouraging but... how do I know if the > call was a GET or a POST? > > I guess that ARequest "knows" it, but I cannot find a way to ask :) Try ARequest.Method, this is the HTTP method string as sent by the client. Michael. From michael at freepascal.org Thu Feb 23 11:11:55 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 23 Feb 2023 11:11:55 +0100 (CET) Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> Message-ID: On Thu, 23 Feb 2023, Luca Olivetti via lazarus wrote: > El 23/2/23 a les 9:43, Michael Van Canneyt via lazarus ha escrit: >> > >>> >>> Something like this: >>> >>> > https://docwiki.embarcadero.com/RADStudio/Rio/en/Browsing_Tables_(FireDAC)#Live_Data_Window_Mode >> >> This is not something that the grid handles. This is a dataset feature. > > Yes, I supposed so > >> >> At this moment I know of no FPC/Lazarus dataset component that handles >> this automatically. > > bummer :-( > >> Note the remark on that page: >> >> "Although FireDAC minimizes the number of generated and executed SQL >> commands in LDW mode, >> ?it still produces a heavier DB load than TFDQuery. So, application >> developers should >> ?carefully choose when to use TFDTable and LDW mode. " >> >> This is exactly why FPC does not have a database table component. It's >> horribly inefficient. > > OTOH a TDBGrid is a very convenient way to display data. > I my application I just use it to display (in read-only mode) an sqlite > table that holds less than 1000 records and it could be updated quite > frequently (hence the need for the frequent TDataset.refresh), and it > works fast enough with that limited amount of records. > Now I need to expand the table to 10000 records and the performance is > unacceptable. The best way is to use "limit N offset M" in your query and use a paging mechanism. Make sure you sort the records, obviously. But IMO: in the first place you should ask yourself if displaying 10.000 records is what you actually want to do. Maybe your application is better off with some filtering ? Michael. From fpc at pascalprogramming.org Thu Feb 23 11:25:51 2023 From: fpc at pascalprogramming.org (Marco van de Voort) Date: Thu, 23 Feb 2023 11:25:51 +0100 Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> Message-ID: <69937a1d-6b7f-f733-4371-f3adc76bdfde@pascalprogramming.org> On 23-2-2023 11:02, Luca Olivetti via lazarus wrote: > > OTOH a TDBGrid is a very convenient way to display data. > I my application I just use it to display (in read-only mode) an > sqlite table that holds less than 1000 records and it could be updated > quite frequently (hence the need for the frequent TDataset.refresh), > and it works fast enough with that limited amount of records. > Now I need to expand the table to 10000 records and the performance is > unacceptable. > Maybe upgrade to a DBMS (like firebird, mssql,postgres) that supports notifications so that you don't have to poll, but get a notification if something changes? From luca at wetron.es Thu Feb 23 11:34:01 2023 From: luca at wetron.es (Luca Olivetti) Date: Thu, 23 Feb 2023 11:34:01 +0100 Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> Message-ID: <3d4dab6c-2af4-04e7-e58b-064b0fd96b2d@wetron.es> El 23/2/23 a les 11:11, Michael Van Canneyt via lazarus ha escrit: > But IMO: in the first place you should ask yourself if displaying 10.000 > records is > what you actually want to do. No, I just need to display 20 or so records, the problem is I'd like the user to be able to scroll over the whole table, so I'd have to hook a lot of events in the TDBGrid (if that's even possible, otherwise I'd have to implement a replacement) and get rid of the TDBNavigator and implement a custom one in its place. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From luca at wetron.es Thu Feb 23 11:37:56 2023 From: luca at wetron.es (Luca Olivetti) Date: Thu, 23 Feb 2023 11:37:56 +0100 Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: <69937a1d-6b7f-f733-4371-f3adc76bdfde@pascalprogramming.org> References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> <69937a1d-6b7f-f733-4371-f3adc76bdfde@pascalprogramming.org> Message-ID: <79c0ea5e-ad6e-5dc3-78f2-185318cba5c0@wetron.es> El 23/2/23 a les 11:25, Marco van de Voort via lazarus ha escrit: > Maybe upgrade to a DBMS (like firebird, mssql,postgres) that supports > notifications so that you don't have to poll, but get a notification if > something changes? No, that's not possible, in any case polling isn't a problem: it's the same application that modifies the table, and it only does the "refresh" when necessary. The problem is that it happens quite frequently (mind me, in a test environment, in the field the updates happen once or twice a minute, but I'm still not comfortable with the refresh taking too long). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From octopushole at gmail.com Thu Feb 23 11:43:28 2023 From: octopushole at gmail.com (duilio foschi) Date: Thu, 23 Feb 2023 11:43:28 +0100 Subject: [Lazarus] TFPHTTPServer In-Reply-To: References: Message-ID: that was it. Thanks a lot Peppe On Thu, Feb 23, 2023 at 11:07 AM Michael Van Canneyt via lazarus wrote: > > > > On Thu, 23 Feb 2023, duilio foschi via lazarus wrote: > > > I wrote a simple server using TFPHTTPServer. > > > > All incoming calls are processed using > > procedure HandleRequest(var ARequest: TFPHTTPConnectionRequest; > > var AResponse: TFPHTTPConnectionResponse); > > > > My first tests were ok and encouraging but... how do I know if the > > call was a GET or a POST? > > > > I guess that ARequest "knows" it, but I cannot find a way to ask :) > > Try ARequest.Method, this is the HTTP method string as sent by the client. > > Michael. > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus From bo.berglund at gmail.com Thu Feb 23 11:48:06 2023 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 23 Feb 2023 11:48:06 +0100 Subject: [Lazarus] Screwed up Lazarus installation - how to make clean and start over? References: <27f0bdb2-4d2f-6fcc-599f-4e12f6cd9cdd@kluug.net> <1htcvhd4mtjl3i1j7c7t675k4unnpl9534@4ax.com> <6d2c9977-84a1-082e-342c-f8e0728a4631@freenet.de> Message-ID: On Wed, 22 Feb 2023 22:59:15 +0100, Werner Pamler via lazarus wrote: >You uninstall a package in the "Package" > "Install/Uninstall packages" >dialog. Select the package to be removed in the left list, click >"Uninstall selection" and then "Save and Rebuild IDE". I did the "Uninstall selection" OK but then I decided to go look for something else so I did not use the rebuild button. Next I went there again to do the rebuild, but now the button is no longer enabled :-( But I found another in Tools/Build Lazarus with profile Normal IDE If I use that will it do the same as the button you referred to? >This will remove bglcontrols which is a runtime/designtime package, but >it will not remove bgrabitmappack - it is a runtime package and thus is >not compiled into the IDE. This cannot crash the compilation of the IDE. >If you also want to get rid of it, go to "Package" > "Package Links", >find it in the list, check it and click "Delete selected". This removes >the path to the package from an internal list so that the IDE no longer >knows where the package is (the files are still there, though - but you >can delete them manually in the OS). I will remove the package folders below pcp dir onlinepackagemanager for these packages. -- Bo Berglund Developer in Sweden From mgr.janusz.chmiel at gmail.com Thu Feb 23 11:54:29 2023 From: mgr.janusz.chmiel at gmail.com (Mgr. Janusz Chmiel) Date: Thu, 23 Feb 2023 11:54:29 +0100 Subject: [Lazarus] Pas2JS_Widget international characters issue Message-ID: <9AF146A0-7301-4FED-BDAA-E3882099137D@hxcore.ol> An HTML attachment was scrubbed... URL: From nc-gaertnma at netcologne.de Thu Feb 23 12:23:55 2023 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Thu, 23 Feb 2023 12:23:55 +0100 Subject: [Lazarus] Screwed up Lazarus installation - how to make clean and start over? In-Reply-To: References: <27f0bdb2-4d2f-6fcc-599f-4e12f6cd9cdd@kluug.net> <1htcvhd4mtjl3i1j7c7t675k4unnpl9534@4ax.com> <6d2c9977-84a1-082e-342c-f8e0728a4631@freenet.de> Message-ID: <20230223122355.18aab8ba@limapholos> On Thu, 23 Feb 2023 11:48:06 +0100 Bo Berglund via lazarus wrote: >[...] > Next I went there again to do the rebuild, but now the button is no > longer enabled :-( > > But I found another in Tools/Build Lazarus with profile Normal IDE > If I use that will it do the same as the button you referred to? Yes. Mattias From jean.suzineau at wanadoo.fr Thu Feb 23 12:24:47 2023 From: jean.suzineau at wanadoo.fr (Jean SUZINEAU) Date: Thu, 23 Feb 2023 12:24:47 +0100 Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: <79c0ea5e-ad6e-5dc3-78f2-185318cba5c0@wetron.es> References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> <69937a1d-6b7f-f733-4371-f3adc76bdfde@pascalprogramming.org> <79c0ea5e-ad6e-5dc3-78f2-185318cba5c0@wetron.es> Message-ID: <27ee55a9-f0a1-7bdd-628a-39b6161c115b@wanadoo.fr> Le 23/02/2023 ? 11:37, Luca Olivetti via lazarus a ?crit?: > No, that's not possible, in any case polling isn't a problem: it's the > same application that modifies the table, and it only does the > "refresh" when necessary. That's exactly a use case for my orm ( https://github.com/jsuzineau/pascal_o_r_mapping/tree/TjsDataContexte ) It's working with the Observer design pattern, no need to poll Unfortunately, I don't have written any documentation. It works with SQLite, there is even a source code generator that can create all the boiler plate code from the SQLite database. All the templates of the source code generator can be customized. Two of my last releases that uses this orm: https://github.com/jsuzineau/pascal_o_r_mapping/releases/tag/2023_02_20_jsWorks https://github.com/jsuzineau/pascal_o_r_mapping/releases/tag/2023_02_17_jsCompta From luca at wetron.es Thu Feb 23 13:11:38 2023 From: luca at wetron.es (Luca Olivetti) Date: Thu, 23 Feb 2023 13:11:38 +0100 Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: <27ee55a9-f0a1-7bdd-628a-39b6161c115b@wanadoo.fr> References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> <69937a1d-6b7f-f733-4371-f3adc76bdfde@pascalprogramming.org> <79c0ea5e-ad6e-5dc3-78f2-185318cba5c0@wetron.es> <27ee55a9-f0a1-7bdd-628a-39b6161c115b@wanadoo.fr> Message-ID: El 23/2/23 a les 12:24, Jean SUZINEAU via lazarus ha escrit: > Le 23/02/2023 ? 11:37, Luca Olivetti via lazarus a ?crit?: >> No, that's not possible, in any case polling isn't a problem: it's the >> same application that modifies the table, and it only does the >> "refresh" when necessary. > That's exactly a use case for my orm ( > https://github.com/jsuzineau/pascal_o_r_mapping/tree/TjsDataContexte ) > It's working with the Observer design pattern, no need to poll Thank you, but from a quick look it doesn't seem to solve the problem at hand. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From michael at freepascal.org Thu Feb 23 13:52:26 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 23 Feb 2023 13:52:26 +0100 (CET) Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: <3d4dab6c-2af4-04e7-e58b-064b0fd96b2d@wetron.es> References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> <3d4dab6c-2af4-04e7-e58b-064b0fd96b2d@wetron.es> Message-ID: On Thu, 23 Feb 2023, Luca Olivetti via lazarus wrote: > El 23/2/23 a les 11:11, Michael Van Canneyt via lazarus ha escrit: >> But IMO: in the first place you should ask yourself if displaying 10.000 >> records is >> what you actually want to do. > > No, I just need to display 20 or so records, the problem is I'd like the user > to be able to scroll over the whole table, so I'd have to hook a lot of > events in the TDBGrid (if that's even possible, otherwise I'd have to > implement a replacement) and get rid of the TDBNavigator and implement a > custom one in its place. The LCL could do with a pager component. Seems to be standard when Web pages display grids/tables, so users should be used to it :-) Michael. From luca at wetron.es Thu Feb 23 16:09:20 2023 From: luca at wetron.es (Luca Olivetti) Date: Thu, 23 Feb 2023 16:09:20 +0100 Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> <3d4dab6c-2af4-04e7-e58b-064b0fd96b2d@wetron.es> Message-ID: <8a446f3f-48f9-37f1-e5d4-9cd7f4b1700a@wetron.es> El 23/2/23 a les 13:52, Michael Van Canneyt via lazarus ha escrit: > > > On Thu, 23 Feb 2023, Luca Olivetti via lazarus wrote: > >> El 23/2/23 a les 11:11, Michael Van Canneyt via lazarus ha escrit: >>> But IMO: in the first place you should ask yourself if displaying >>> 10.000 records is >>> what you actually want to do. >> >> No, I just need to display 20 or so records, the problem is I'd like >> the user to be able to scroll over the whole table, so I'd have to >> hook a lot of events in the TDBGrid (if that's even possible, >> otherwise I'd have to implement a replacement) and get rid of the >> TDBNavigator and implement a custom one in its place. > > The LCL could do with a pager component. Seems to be standard when Web > pages > display grids/tables, so users should be used to it :-) Even if such a component existed, I don't think it would fit my use-case. Maybe I should just write a TDataset descendant tailor made for this application, any pointer on how to write a minimal descendant? I'm looking at the TMemDataset implementation as an example, is it a good one? The idea is to substitute open and scrolling (next/prior/locate/etc.) with the appropriate sql statements to just retrieve a small buffer of data around the current record (I can do that easily enough), though I'm not sure that would be enough to fool the TDBGrid. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From michael at freepascal.org Thu Feb 23 17:16:00 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 23 Feb 2023 17:16:00 +0100 (CET) Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: <8a446f3f-48f9-37f1-e5d4-9cd7f4b1700a@wetron.es> References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> <3d4dab6c-2af4-04e7-e58b-064b0fd96b2d@wetron.es> <8a446f3f-48f9-37f1-e5d4-9cd7f4b1700a@wetron.es> Message-ID: On Thu, 23 Feb 2023, Luca Olivetti via lazarus wrote: > El 23/2/23 a les 13:52, Michael Van Canneyt via lazarus ha escrit: >> >> >> On Thu, 23 Feb 2023, Luca Olivetti via lazarus wrote: >> >>> El 23/2/23 a les 11:11, Michael Van Canneyt via lazarus ha escrit: >>>> But IMO: in the first place you should ask yourself if displaying 10.000 >>>> records is >>>> what you actually want to do. >>> >>> No, I just need to display 20 or so records, the problem is I'd like the >>> user to be able to scroll over the whole table, so I'd have to hook a lot >>> of events in the TDBGrid (if that's even possible, otherwise I'd have to >>> implement a replacement) and get rid of the TDBNavigator and implement a >>> custom one in its place. >> >> The LCL could do with a pager component. Seems to be standard when Web >> pages >> display grids/tables, so users should be used to it :-) > > Even if such a component existed, I don't think it would fit my use-case. Why do you think so ? Paging is exactly what you want to do. > Maybe I should just write a TDataset descendant tailor made for this > application, any pointer on how to write a minimal descendant? > I'm looking at the TMemDataset implementation as an example, is it a good > one? As good as any other. > The idea is to substitute open and scrolling (next/prior/locate/etc.) with > the appropriate sql statements to just retrieve a small buffer of data around > the current record (I can do that easily enough), though I'm not sure that > would be enough to fool the TDBGrid. I don't know what the grid exactly does, so I cannot advise. Michael. From luca at wetron.es Thu Feb 23 19:38:20 2023 From: luca at wetron.es (Luca Olivetti) Date: Thu, 23 Feb 2023 19:38:20 +0100 Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> <3d4dab6c-2af4-04e7-e58b-064b0fd96b2d@wetron.es> <8a446f3f-48f9-37f1-e5d4-9cd7f4b1700a@wetron.es> Message-ID: El 23/2/23 a les 17:16, Michael Van Canneyt ha escrit: >> Even if such a component existed, I don't think it would fit my use-case. > > Why do you think so ? Paging is exactly what you want to do. Not exactly, I mean, yes, it is paging but it has to be "transparent", I don't want to add "previous page" and "next page" buttons. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From luca at wetron.es Fri Feb 24 10:44:02 2023 From: luca at wetron.es (Luca Olivetti) Date: Fri, 24 Feb 2023 10:44:02 +0100 Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> <3d4dab6c-2af4-04e7-e58b-064b0fd96b2d@wetron.es> <8a446f3f-48f9-37f1-e5d4-9cd7f4b1700a@wetron.es> Message-ID: El 23/2/23 a les 17:16, Michael Van Canneyt ha escrit: write a TDataset descendant tailor made for this >> application, any pointer on how to write a minimal descendant? >> I'm looking at the TMemDataset implementation as an example, is it a >> good one? > > As good as any other. > >> The idea is to substitute open and scrolling (next/prior/locate/etc.) >> with the appropriate sql statements to just retrieve a small buffer of >> data around the current record (I can do that easily enough), though >> I'm not sure that would be enough to fool the TDBGrid. > > I don't know what the grid exactly does, so I cannot advise. I did some tests and the grid is not a problem (it only fetches the records that are visible), the TDataset is: either I am blind or the only way for the TDataset to realize there is data is to fetch every record and allocate the corresponding buffers. That's because FRecordCount/FBof/FEof are private procedure TDataSet.DoInternalOpen; begin InternalOpen; FInternalOpenComplete := True; {$ifdef dsdebug} Writeln ('Calling internal open'); {$endif} {$ifdef dsdebug} Writeln ('Calling RecalcBufListSize'); {$endif} FRecordCount := 0; RecalcBufListSize; <-- this will fetch all the records FBOF := True; FEOF := (FRecordCount = 0); <--- FRecordCount must be set end; There's no point overriding GetNextRecords/GetNextRecord/GetPriorRecords/GetPriorRecord (called by RecalcBufListSize) since I cannot directly modify the private fields of the TDataSet. Any idea? Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From mgr.janusz.chmiel at gmail.com Fri Feb 24 11:06:41 2023 From: mgr.janusz.chmiel at gmail.com (Mgr. Janusz Chmiel) Date: Fri, 24 Feb 2023 11:06:41 +0100 Subject: [Lazarus] accessible lazarus with nvda screen reader Message-ID: <709A29FD-407B-4EDE-B4AE-0B02818F05F3@hxcore.ol> An HTML attachment was scrubbed... URL: From michael at freepascal.org Fri Feb 24 11:10:32 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Fri, 24 Feb 2023 11:10:32 +0100 (CET) Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> <3d4dab6c-2af4-04e7-e58b-064b0fd96b2d@wetron.es> <8a446f3f-48f9-37f1-e5d4-9cd7f4b1700a@wetron.es> Message-ID: On Fri, 24 Feb 2023, Luca Olivetti via lazarus wrote: > El 23/2/23 a les 17:16, Michael Van Canneyt ha escrit: > > write a TDataset descendant tailor made for this >>> application, any pointer on how to write a minimal descendant? >>> I'm looking at the TMemDataset implementation as an example, is it a good >>> one? >> >> As good as any other. >> >>> The idea is to substitute open and scrolling (next/prior/locate/etc.) with >>> the appropriate sql statements to just retrieve a small buffer of data >>> around the current record (I can do that easily enough), though I'm not >>> sure that would be enough to fool the TDBGrid. >> >> I don't know what the grid exactly does, so I cannot advise. > > I did some tests and the grid is not a problem (it only fetches the records > that are visible), the TDataset is: either I am blind or the only way for > the TDataset to realize there is data is to fetch every record and allocate > the corresponding buffers. > That's because FRecordCount/FBof/FEof are private FRecordCount is the number of records in internal buffers, and has nothing to do with the total number of records. The total RecordCount must be given by TDataset descendents, but defaults to FRecordCount in TDataset itself. The terminology is confusing, I know. We should probably rename FRecordCount to FBufferRecordCount. > > procedure TDataSet.DoInternalOpen; > > begin > InternalOpen; > FInternalOpenComplete := True; > {$ifdef dsdebug} > Writeln ('Calling internal open'); > {$endif} > {$ifdef dsdebug} > Writeln ('Calling RecalcBufListSize'); > {$endif} > FRecordCount := 0; > RecalcBufListSize; <-- this will fetch all the records > FBOF := True; > FEOF := (FRecordCount = 0); <--- FRecordCount must be set > end; No. RecalcBufListSize does not necessarily fetch all the records. It fetches as much records as needed: 10 by default, but classes such as TDBGrid may set the number of needed records to the number of visible grid lines. It can be that TBufDataset fetches all records on open, there is a property that controls this. But it can also fetch on an as-neede basis. FEOF is simply initialized from the first batch. But it is maintained based on the result of GetNextRecord. Check the MoveBy procedure. Only when GetNextRecord returns false, is FEOF set to True (line 2005). > There's no point overriding > GetNextRecords/GetNextRecord/GetPriorRecords/GetPriorRecord (called by > RecalcBufListSize) since I cannot directly modify the private fields of the > TDataSet. You don't need to modify them. They are automatically maintained based on the result of GetNextRecord. TDataset is responsible for maintaining a correct state based on what descendants return in the methods they override. Exposing these internal state fields for modification means TDataset cannot guarantee the correct state, and therefore that will not happen. > > Any idea? Personally, I believe you are on the wrong path by wanting to modify TDataset or its descendants. But if you want to pursue that track, study TDataset a little more and ask questions. It is a complex class, one of the most complex in the whole FCL. Michael. From luca at wetron.es Fri Feb 24 16:44:16 2023 From: luca at wetron.es (Luca Olivetti) Date: Fri, 24 Feb 2023 16:44:16 +0100 Subject: [Lazarus] db grid/dataset components that only load currently visible records? In-Reply-To: References: <1421e62f-a3f6-63eb-1242-a66f99231c52@wetron.es> <33bde8f0-06f7-3786-a044-9d262b2e4839@wetron.es> <3d4dab6c-2af4-04e7-e58b-064b0fd96b2d@wetron.es> <8a446f3f-48f9-37f1-e5d4-9cd7f4b1700a@wetron.es> Message-ID: <945b58c4-087c-cb35-7be5-febdffa3eb6e@wetron.es> El 24/2/23 a les 11:10, Michael Van Canneyt via lazarus ha escrit: > No. > > RecalcBufListSize does not necessarily fetch all the records. It fetches as > much records as needed: 10 by default, but classes such as TDBGrid may set > the number of needed records to the number of visible grid lines. > > It can be that TBufDataset fetches all records on open, there is a > property that > controls this. But it can also fetch on an as-neede basis. > > FEOF is simply initialized from the first batch. But it is maintained > based on the result of GetNextRecord. Check the MoveBy procedure. > > Only when GetNextRecord returns false, is FEOF set to True (line 2005). Thank you! With these insights (and a lot of sweat, blood and tears ;-)) I managed to write a descendant dataset that does what I want. Not 100% complete yet but getting there. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From jmlandmesser at gmx.de Fri Feb 24 21:35:06 2023 From: jmlandmesser at gmx.de (John Landmesser) Date: Fri, 24 Feb 2023 21:35:06 +0100 Subject: [Lazarus] converted Delphi 7 project: add new form not possible? Message-ID: Hi, I tried to extend an existing and converted? Delphi 7 project by adding new form to the converted Delphi 7 project. But that leads to an AV-error if i try to show this new form by code! Sample not yet converted? Delphi 7 project: I hope i configured my google drive correct so this link works for downloading?! https://drive.google.com/file/d/1PgY5sR9cXnhtQQgG5zpfMd2lEFg65kkN/view?usp=sharing Tipps are welcome John Landmesser From jmlandmesser at gmx.de Fri Feb 24 21:51:29 2023 From: jmlandmesser at gmx.de (John Landmesser) Date: Fri, 24 Feb 2023 21:51:29 +0100 Subject: [Lazarus] converted Delphi 7 project: add new form not possible? In-Reply-To: References: Message-ID: Sorry sysinfo missing: Lazarus: Lazarus 2.3.0 (rev main-2_3-2873-g17b66f88c4) FPC 3.2.2 x86_64-linux-gtk2 On Manjaro XFCE Linux: System: ? Kernel: 6.1.1-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.0 Desktop: Xfce v: 4.18.0 ??? Distro: Manjaro Linux base: Arch Linux Machine: ? Type: Laptop System: LENOVO product: 81RS v: Lenovo Yoga S740-14IIL serial: ? Mobo: LENOVO model: LNVNB161216 v: SDK0J40709 WIN serial: UEFI: LENOVO ??? v: BYCN39WW date: 05/28/2021 Battery: ? ID-1: BAT0 charge: 63.7 Wh (97.5%) condition: 65.3/62.0 Wh (105.3%) volts: 17.1 min: 15.4 ??? model: LGC L19L4PD2 status: full CPU: ? Info: quad core model: Intel Core i7-1065G7 bits: 64 type: MT MCP arch: Ice Lake rev: 5 cache: ??? L1: 320 KiB L2: 2 MiB L3: 8 MiB ? Speed (MHz): avg: 1367 high: 1500 min/max: 400/3900 cores: 1: 1299 2: 1300 3: 1500 4: 1500 ??? 5: 1275 6: 1500 7: 1300 8: 1262 bogomips: 23968 ? Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx Delphi 7 Pro on Windows 10 Home Am 24.02.23 um 21:35 schrieb John Landmesser via lazarus: > Hi, > > I tried to extend an existing and converted? Delphi 7 project by adding > new form to the converted Delphi 7 project. > > But that leads to an AV-error if i try to show this new form by code! > > > Sample not yet converted? Delphi 7 project: > > I hope i configured my google drive correct so this link works for > downloading?! > > > https://drive.google.com/file/d/1PgY5sR9cXnhtQQgG5zpfMd2lEFg65kkN/view?usp=sharing > > > > Tipps are welcome > > John Landmesser > From vojtech.cihak at atlas.cz Fri Feb 24 22:21:28 2023 From: vojtech.cihak at atlas.cz (=?utf-8?q?Vojt=c4=9bch_=c4=8cih=c3=a1k?=) Date: Fri, 24 Feb 2023 22:21:28 +0100 Subject: [Lazarus] =?utf-8?q?converted_Delphi_7_project=3A_add_new_form_n?= =?utf-8?q?ot_possible=3F?= In-Reply-To: References: Message-ID: <20230224222128.BD8E3992@atlas.cz> Hi, ? it is my new experience with Delphi project convertor. I noticed that: The converted unit1 has: ?TForm1 = class(TForm) ? ? ListBox1: TListBox; ? ? Button1: TButton;? ? ? ? ?.... And when I add a new form, i.e. unit2, it has also TForm1 = class(TForm) ? private ? .... ? Normally (common Lazarus project) it creates unit2 + Form2. ? Vojt?ch ?? ______________________________________________________________ > Od: "John Landmesser via lazarus" > Komu: lazarus at lists.lazarus-ide.org > Datum: 24.02.2023 21:51 > P?edm?t: Re: [Lazarus] converted Delphi 7 project: add new form not possible? > > John Landmesser > -- _______________________________________________ lazarus mailing list lazarus at lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmlandmesser at gmx.de Fri Feb 24 22:26:02 2023 From: jmlandmesser at gmx.de (John Landmesser) Date: Fri, 24 Feb 2023 22:26:02 +0100 Subject: [Lazarus] converted Delphi 7 project: add new form not possible? In-Reply-To: <20230224222128.BD8E3992@atlas.cz> References: <20230224222128.BD8E3992@atlas.cz> Message-ID: Am 24.02.23 um 22:21 schrieb Vojt?ch ?ih?k via lazarus: > > Hi, > > it is my new experience with Delphi project convertor. > > I noticed that: > > The converted unit1 has: > > ?TForm1 = class(TForm) > > ? ? ListBox1: TListBox; > > ? ? Button1: TButton; > > ? ?.... > > And when I add a new form, i.e. unit2, it has also > > TForm1 = class(TForm) > > ? private > > ? .... > > Normally (common Lazarus project) it creates unit2 + Form2. > > Vojt?ch > That is correct, but when? you are saving the new form you can give it new names?! > > ______________________________________________________________ > > Od: "John Landmesser via lazarus" > > Komu: lazarus at lists.lazarus-ide.org > > Datum: 24.02.2023 21:51 > > P?edm?t: Re: [Lazarus] converted Delphi 7 project: add new form not > possible? > > > > > John Landmesser > > > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vojtech.cihak at atlas.cz Fri Feb 24 22:51:31 2023 From: vojtech.cihak at atlas.cz (=?utf-8?q?Vojt=c4=9bch_=c4=8cih=c3=a1k?=) Date: Fri, 24 Feb 2023 22:51:31 +0100 Subject: [Lazarus] =?utf-8?q?converted_Delphi_7_project=3A_add_new_form_n?= =?utf-8?q?ot_possible=3F?= In-Reply-To: References: , , <20230224222128.BD8E3992@atlas.cz> Message-ID: <20230224225131.7BC0B12F@atlas.cz> Yes, files are unit2.pas and unit2.lfm so you must manually rename the class and the form. ? I tried to rename the second Form1 to Form2 in Object Inspector but it automatically changed line Application.CreateForm(TForm1, Form1); to Application.CreateForm(TForm2, Form2); in ProjectD7.lpr Buit this line autocreates the first Form1! ? So it's a little mess. Anyway, Lazarus shouldn't create two TForm1 classes in one project. ? V. ______________________________________________________________ > Od: "John Landmesser via lazarus" > Komu: lazarus at lists.lazarus-ide.org > Datum: 24.02.2023 22:26 > P?edm?t: Re: [Lazarus] converted Delphi 7 project: add new form not possible? > Am 24.02.23 um 22:21 schrieb Vojt?ch ?ih?k via lazarus:Hi, ? it is my new experience with Delphi project convertor. I noticed that: The converted unit1 has: ?TForm1 = class(TForm) ? ? ListBox1: TListBox; ? ? Button1: TButton;? ? ? ? ?.... And when I add a new form, i.e. unit2, it has also TForm1 = class(TForm) ? private ? .... ? Normally (common Lazarus project) it creates unit2 + Form2. ? Vojt?ch That is correct, but when? you are saving the new form you can give it new names?! ? ? ______________________________________________________________ > Od: "John Landmesser via lazarus" > Komu: lazarus at lists.lazarus-ide.org > Datum: 24.02.2023 21:51 > P?edm?t: Re: [Lazarus] converted Delphi 7 project: add new form not possible? > > John Landmesser > -- _______________________________________________ lazarus mailing list lazarus at lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus ? ---------- -- _______________________________________________ lazarus mailing list lazarus at lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmlandmesser at gmx.de Fri Feb 24 22:59:06 2023 From: jmlandmesser at gmx.de (John Landmesser) Date: Fri, 24 Feb 2023 22:59:06 +0100 Subject: [Lazarus] converted Delphi 7 project: add new form not possible? In-Reply-To: <20230224225131.7BC0B12F@atlas.cz> References: <20230224222128.BD8E3992@atlas.cz> <20230224225131.7BC0B12F@atlas.cz> Message-ID: .. and now the most interesting part: Try to show form2 with the button on Delphi 7 converted form. Before that add under implementation section: uses unit2; Now i get the AV-Error message if i try to show form2! You too see an error mesage? From werner.pamler at freenet.de Fri Feb 24 23:00:17 2023 From: werner.pamler at freenet.de (Werner Pamler) Date: Fri, 24 Feb 2023 23:00:17 +0100 Subject: [Lazarus] converted Delphi 7 project: add new form not possible? In-Reply-To: References: Message-ID: <7986a240-e81c-6226-f466-96b4a069dbf8@freenet.de> Am 24.02.2023 um 21:35 schrieb John Landmesser via lazarus: > Hi, > > I tried to extend an existing and converted? Delphi 7 project by adding > new form to the converted Delphi 7 project. > > But that leads to an AV-error if i try to show this new form by code! I normally convert Delphi projects manually - it's more work, but I know what's happening then... And the manual conversion of your test project worked flawlessly. But anyway: When trying to use the IDE's Delphi converter I saw two problems: /1/ The newly added form is named Form1 (type TForm1) and this screws up the entire project since these identifiers already exist in the Delphi project. I can circumvent this issue when I close the IDE after conversion and create the new form only after a restart. /2/ But this does not prevent the other issue: The IDE refuses to add the new form to the list of auto-created forms, and therefore a call of "Form2.Show" in the OnClick handler of your button on Form1 must fail. I have no idea what prevents the new form from being auto-created. As a work-around I added the line "Application.CreateForm(TForm2, Form2);" to the project unit manually (and Unit2 to its uses clause). - This way it works. Please file a bug report. From jmlandmesser at gmx.de Fri Feb 24 23:08:23 2023 From: jmlandmesser at gmx.de (John Landmesser) Date: Fri, 24 Feb 2023 23:08:23 +0100 Subject: [Lazarus] converted Delphi 7 project: add new form not possible? In-Reply-To: <7986a240-e81c-6226-f466-96b4a069dbf8@freenet.de> References: <7986a240-e81c-6226-f466-96b4a069dbf8@freenet.de> Message-ID: <9fbfdcd5-7940-c7b5-042c-0d9954a76967@gmx.de> Am 24.02.23 um 23:00 schrieb Werner Pamler via lazarus: > Am 24.02.2023 um 21:35 schrieb John Landmesser via lazarus: >> Hi, >> >> I tried to extend an existing and converted? Delphi 7 project by adding >> new form to the converted Delphi 7 project. >> >> But that leads to an AV-error if i try to show this new form by code! > > I normally convert Delphi projects manually - it's more work, but I > know what's happening then... And the manual conversion of your test > project worked flawlessly. > > But anyway: When trying to use the IDE's Delphi converter I saw two > problems: > > /1/ The newly added form is named Form1 (type TForm1) and this screws > up the entire project since these identifiers already exist in the > Delphi project. I can circumvent this issue when I close the IDE after > conversion and create the new form only after a restart. > > /2/ But this does not prevent the other issue: The IDE refuses to add > the new form to the list of auto-created forms, and therefore a call > of "Form2.Show" in the OnClick handler of your button on Form1 must > fail. I have no idea what prevents the new form from being > auto-created. As a work-around I added the line > "Application.CreateForm(TForm2, Form2);" to the project unit manually > (and Unit2 to its uses clause). - This way it works. > > Please file a bug report. > Thanks for your investigation.! I'll file a bug report tomorrow. Regards John Landmesser From jmlandmesser at gmx.de Fri Feb 24 23:26:46 2023 From: jmlandmesser at gmx.de (John Landmesser) Date: Fri, 24 Feb 2023 23:26:46 +0100 Subject: [Lazarus] converted Delphi 7 project: add new form not possible? In-Reply-To: <7986a240-e81c-6226-f466-96b4a069dbf8@freenet.de> References: <7986a240-e81c-6226-f466-96b4a069dbf8@freenet.de> Message-ID: <85068fb7-002e-6a38-f6bd-95f98d63fba3@gmx.de> Am 24.02.23 um 23:00 schrieb Werner Pamler via lazarus: > Am 24.02.2023 um 21:35 schrieb John Landmesser via lazarus: >> Hi, >> >> I tried to extend an existing and converted? Delphi 7 project by adding >> new form to the converted Delphi 7 project. >> >> But that leads to an AV-error if i try to show this new form by code! > > I normally convert Delphi projects manually - it's more work, but I > know what's happening then... And the manual conversion of your test > project worked flawlessly. > > But anyway: When trying to use the IDE's Delphi converter I saw two > problems: > > /1/ The newly added form is named Form1 (type TForm1) and this screws > up the entire project since these identifiers already exist in the > Delphi project. I can circumvent this issue when I close the IDE after > conversion and create the new form only after a restart. > > /2/ But this does not prevent the other issue: The IDE refuses to add > the new form to the list of auto-created forms, and therefore a call > of "Form2.Show" in the OnClick handler of your button on Form1 must > fail. I have no idea what prevents the new form from being > auto-created. As a work-around I added the line > "Application.CreateForm(TForm2, Form2);" to the project unit manually > (and Unit2 to its uses clause). - This way it works. > > Please file a bug report. > Thanks for your investigation.! I'll file a bug report tomorrow. Regards John Landmesser From jmlandmesser at gmx.de Sat Feb 25 13:43:53 2023 From: jmlandmesser at gmx.de (John Landmesser) Date: Sat, 25 Feb 2023 13:43:53 +0100 Subject: [Lazarus] converted Delphi 7 project: add new form not possible? In-Reply-To: <7986a240-e81c-6226-f466-96b4a069dbf8@freenet.de> References: <7986a240-e81c-6226-f466-96b4a069dbf8@freenet.de> Message-ID: <85f35b36-a20d-cba7-af82-defb24ddbad9@gmx.de> Am 24.02.23 um 23:00 schrieb Werner Pamler via lazarus: > Am 24.02.2023 um 21:35 schrieb John Landmesser via lazarus: >> Hi, >> >> I tried to extend an existing and converted? Delphi 7 project by adding >> new form to the converted Delphi 7 project. >> >> But that leads to an AV-error if i try to show this new form by code! > > I normally convert Delphi projects manually - it's more work, but I > know what's happening then... And the manual conversion of your test > project worked flawlessly. > > But anyway: When trying to use the IDE's Delphi converter I saw two > problems: > > /1/ The newly added form is named Form1 (type TForm1) and this screws > up the entire project since these identifiers already exist in the > Delphi project. I can circumvent this issue when I close the IDE after > conversion and create the new form only after a restart. > > /2/ But this does not prevent the other issue: The IDE refuses to add > the new form to the list of auto-created forms, and therefore a call > of "Form2.Show" in the OnClick handler of your button on Form1 must > fail. I have no idea what prevents the new form from being > auto-created. As a work-around I added the line > "Application.CreateForm(TForm2, Form2);" to the project unit manually > (and Unit2 to its uses clause). - This way it works. > > Please file a bug report. > done! https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40132 From mgr.janusz.chmiel at gmail.com Sun Feb 26 13:25:57 2023 From: mgr.janusz.chmiel at gmail.com (Mgr. Janusz Chmiel) Date: Sun, 26 Feb 2023 13:25:57 +0100 Subject: [Lazarus] Linux apps and gtk version choosing Message-ID: An HTML attachment was scrubbed... URL: From bartjunk64 at gmail.com Sun Feb 26 14:29:41 2023 From: bartjunk64 at gmail.com (Bart) Date: Sun, 26 Feb 2023 14:29:41 +0100 Subject: [Lazarus] Linux apps and gtk version choosing In-Reply-To: References: Message-ID: On Sun, Feb 26, 2023 at 2:26?PM Mgr. Janusz Chmiel via lazarus wrote: > IIs it possible from Lazarus IDE, Form window or only from source code of app? Lazarus: Compiler Options -> Config and Target -> "Select another LCL widgetset (macro LCLWidgetType)" -- Bart From badsector at runtimeterror.com Sun Feb 26 14:36:31 2023 From: badsector at runtimeterror.com (Kostas Michalopoulos) Date: Sun, 26 Feb 2023 15:36:31 +0200 Subject: [Lazarus] Linux apps and gtk version choosing In-Reply-To: References: Message-ID: <60f0ce38-1e0c-3e61-fca3-701e94b61281@runtimeterror.com> On 2/26/23 14:25, Mgr. Janusz Chmiel via lazarus wrote: > Where to change GTK version from 2.0 to 3.0? > > IIs it possible from Lazarus IDE, Form window or only from source code > of app? Project -> Project Options -> Additions and Overrides (under Compiler Options near the bottom of the sidebar on the left) -> Click Set "LCL WidgetType" -> Pick one of the available options (not that not all options will work, but gtk2 and gtk3 should work and qt5 will work if you have libqt5pas installed). Kostas From octopushole at gmail.com Sun Feb 26 20:05:39 2023 From: octopushole at gmail.com (duilio foschi) Date: Sun, 26 Feb 2023 20:05:39 +0100 Subject: [Lazarus] questioning ARequest: TFPHTTPConnectionRequest :) Message-ID: my simple BE server uses this function to handle all inbound calls: procedure TTestHTTPServer.HandleRequest( var ARequest: TFPHTTPConnectionRequest; var AResponse: TFPHTTPConnectionResponse ); When the call is a POST, I want to read the json payload inside ARequest. I expected to find a property like Body:string inside TFPHTTPConnectionRequest, but I could not find it. How do I get the the json payload which is inside ARequest? Thank you Peppe From mgr.janusz.chmiel at gmail.com Sun Feb 26 20:37:51 2023 From: mgr.janusz.chmiel at gmail.com (Mgr. Janusz Chmiel) Date: Sun, 26 Feb 2023 20:37:51 +0100 Subject: [Lazarus] who could add new gui elements support to pandroid azcforms unit Message-ID: <088BAA81-2D5D-4CFF-9134-D4F2602ABDDB@hxcore.ol> An HTML attachment was scrubbed... URL: From michael at freepascal.org Mon Feb 27 08:23:24 2023 From: michael at freepascal.org (Michael Van Canneyt) Date: Mon, 27 Feb 2023 08:23:24 +0100 (CET) Subject: [Lazarus] questioning ARequest: TFPHTTPConnectionRequest :) In-Reply-To: References: Message-ID: On Sun, 26 Feb 2023, duilio foschi via lazarus wrote: > my simple BE server uses this function to handle all inbound calls: > > procedure TTestHTTPServer.HandleRequest( > var ARequest: TFPHTTPConnectionRequest; > var AResponse: TFPHTTPConnectionResponse > ); > > When the call is a POST, I want to read the json payload inside ARequest. > > I expected to find a property like Body:string inside > TFPHTTPConnectionRequest, but I could not find it. The property is called Content. Michael. From mgr.janusz.chmiel at gmail.com Mon Feb 27 10:56:16 2023 From: mgr.janusz.chmiel at gmail.com (Mgr. Janusz Chmiel) Date: Mon, 27 Feb 2023 10:56:16 +0100 Subject: [Lazarus] why can not lamw add assigned components from the list to the form automatically Message-ID: An HTML attachment was scrubbed... URL: From jean.suzineau at wanadoo.fr Mon Feb 27 14:20:04 2023 From: jean.suzineau at wanadoo.fr (Jean SUZINEAU) Date: Mon, 27 Feb 2023 14:20:04 +0100 Subject: [Lazarus] why can not lamw add assigned components from the list to the form automatically In-Reply-To: References: Message-ID: <81e6dd43-ea99-6aac-bf6d-37a5d6427412@wanadoo.fr> Curious behaviour. You can find the source of the component list form in your lazarus installation directory in ide\componentlist.pas. I imagine something is failing in TComponentListForm.AddSelectedComponent, may be due to differences in the Designer ? From mgr.janusz.chmiel at gmail.com Mon Feb 27 14:50:24 2023 From: mgr.janusz.chmiel at gmail.com (Mgr. Janusz Chmiel) Date: Mon, 27 Feb 2023 14:50:24 +0100 Subject: [Lazarus] why can not lamw add assigned components from the list to the form automatically In-Reply-To: <81e6dd43-ea99-6aac-bf6d-37a5d6427412@wanadoo.fr> References: , <81e6dd43-ea99-6aac-bf6d-37a5d6427412@wanadoo.fr> Message-ID: <9BA5AD86-94D2-4E8A-B98B-3A5B91C93135@hxcore.ol> An HTML attachment was scrubbed... URL: From mgr.janusz.chmiel at gmail.com Mon Feb 27 18:51:55 2023 From: mgr.janusz.chmiel at gmail.com (Mgr. Janusz Chmiel) Date: Mon, 27 Feb 2023 18:51:55 +0100 Subject: [Lazarus] strange focus behaviour on source editor window Message-ID: <90A6DB4A-9ED9-4B3D-B3FF-085B85F7548F@hxcore.ol> An HTML attachment was scrubbed... URL: From mgr.janusz.chmiel at gmail.com Mon Feb 27 19:26:14 2023 From: mgr.janusz.chmiel at gmail.com (Mgr. Janusz Chmiel) Date: Mon, 27 Feb 2023 19:26:14 +0100 Subject: [Lazarus] LCL accessibility and lcl memory management congratulation Message-ID: <5D39EB20-1833-49FE-9B0C-96E07166A5CE@hxcore.ol> An HTML attachment was scrubbed... URL: From zeljko at holobit.hr Mon Feb 27 20:38:27 2023 From: zeljko at holobit.hr (zeljko) Date: Mon, 27 Feb 2023 20:38:27 +0100 Subject: [Lazarus] strange focus behaviour on source editor window In-Reply-To: <90A6DB4A-9ED9-4B3D-B3FF-085B85F7548F@hxcore.ol> References: <90A6DB4A-9ED9-4B3D-B3FF-085B85F7548F@hxcore.ol> Message-ID: On 27. 02. 2023. 18:51, Mgr. Janusz Chmiel via lazarus wrote: > Dear Lazarus developers, > > ?????????? I have found out very interesting and strange focus > behaviour in Lazarus IDE. > > When I edit The source code in The source editor Editable field. And > when I switch window to desktop and when I switch back to Lazarus IDE, > focus is not located at source editor editable field. > > Focus jump automatically to The TAB with components list. The object > class name is > > Does this behaviour have a good thinked intention for developers? Or it > should not appear? > > I must always press F12 twice to have source editor Edit box on focus. > > Thank you for your explanation. Operating system ? Lazarus version ? Widgetset if it's x11 ? zeljko From lazarus at mfriebe.de Mon Feb 27 21:37:50 2023 From: lazarus at mfriebe.de (Martin Frb) Date: Mon, 27 Feb 2023 21:37:50 +0100 Subject: [Lazarus] strange focus behaviour on source editor window In-Reply-To: <90A6DB4A-9ED9-4B3D-B3FF-085B85F7548F@hxcore.ol> References: <90A6DB4A-9ED9-4B3D-B3FF-085B85F7548F@hxcore.ol> Message-ID: It does not happen to me, tested Win 10 and Win 11. For me focus goes back to the source editor. I switched back to the IDE with Alt-Tab. Maybe you use some other way? I also tried by clicking the icon in the taskbar, and that worked (tested Win 10 only). Do you have any packages installed? (Maybe Anchor-Docking?) On 27/02/2023 18:51, Mgr. Janusz Chmiel via lazarus wrote: > > Dear Lazarus developers, > > ?????????? I have found out very interesting and strange focus > behaviour in Lazarus IDE. > > When I edit The source code in The source editor Editable field. And > when I switch window to desktop and when I switch back to Lazarus IDE, > focus is not located at source editor editable field. > > Focus jump automatically to The TAB with components list. The object > class name is > > Does this behaviour have a good thinked intention for developers? Or > it should not appear? > > I must always press F12 twice to have source editor Edit box on focus. > > Thank you for your explanation. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From octopushole at gmail.com Mon Feb 27 21:41:23 2023 From: octopushole at gmail.com (duilio foschi) Date: Mon, 27 Feb 2023 21:41:23 +0100 Subject: [Lazarus] questioning ARequest: TFPHTTPConnectionRequest :) In-Reply-To: References: Message-ID: It belongs to TFPHTTPConnectionRequest's grandfather (ancestor of ancestor). Silly of me, I had gone back only one generation! :) Thank you Peppe On Mon, Feb 27, 2023 at 8:23 AM Michael Van Canneyt via lazarus wrote: > > > > On Sun, 26 Feb 2023, duilio foschi via lazarus wrote: > > > my simple BE server uses this function to handle all inbound calls: > > > > procedure TTestHTTPServer.HandleRequest( > > var ARequest: TFPHTTPConnectionRequest; > > var AResponse: TFPHTTPConnectionResponse > > ); > > > > When the call is a POST, I want to read the json payload inside ARequest. > > > > I expected to find a property like Body:string inside > > TFPHTTPConnectionRequest, but I could not find it. > > The property is called Content. > > Michael. > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus