[Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Mark Morgan Lloyd
On unix (Linux, Solaris etc.) is it possible to determine how a program written using Lazarus is being terminated? Specifically, is there any different behaviour when a kill signal arrives from a routine term signal, and is a title-bar close button simply a term signal? I'm trying to

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Sven Barth
On 16.02.2013 09:22, Mark Morgan Lloyd wrote: On unix (Linux, Solaris etc.) is it possible to determine how a program written using Lazarus is being terminated? Specifically, is there any different behaviour when a kill signal arrives from a routine term signal, and is a title-bar close

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Mark Morgan Lloyd
Sven Barth wrote: On 16.02.2013 09:22, Mark Morgan Lloyd wrote: On unix (Linux, Solaris etc.) is it possible to determine how a program written using Lazarus is being terminated? Specifically, is there any different behaviour when a kill signal arrives from a routine term signal, and is a

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Ludo Brands
On 02/16/2013 10:54 AM, Mark Morgan Lloyd wrote: OK, so a hypothetical program with term hooked makes sure it behaves like a window manager close. If multiple related programs are shut down manually by the user (WM or term signal) they can put up a dialogue asking whether the state is to be

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Sven Barth
On 16.02.2013 10:54, Mark Morgan Lloyd wrote: I'm trying to think ahead and plan for what a bunch of related (but not necessarily tightly-coupled) programs do if there's e.g. a UPS shutdown notification which sends a kill signal. Specifically, if there's a routine term it is probably

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Sven Barth
The thing that initially got me jittery was a shutdown script (from an elderly Slackware) that first signalled term to everything, waited five seconds and signalled kill. But if the term resulted in a dialogue asking whether the state is to be saved then presumably the kill would never OK this.

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Mark Morgan Lloyd
Ludo Brands wrote: On 02/16/2013 10:54 AM, Mark Morgan Lloyd wrote: OK, so a hypothetical program with term hooked makes sure it behaves like a window manager close. If multiple related programs are shut down manually by the user (WM or term signal) they can put up a dialogue asking whether the

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Sven Barth
On 16.02.2013 11:46, Mark Morgan Lloyd wrote: Sven Barth wrote: On 16.02.2013 10:54, Mark Morgan Lloyd wrote: I'm trying to think ahead and plan for what a bunch of related (but not necessarily tightly-coupled) programs do if there's e.g. a UPS shutdown notification which sends a kill

Re: [Lazarus] Problem with zeos and sqlite-3

2013-02-16 Thread TonyMc
On Fri, 15 Feb 2013 13:43:21 +0100 (CET), you wrote: You should use a real database instead of sqlite. sqlite is good only for storing strings. I don't know what you mean by a real database but you are wrong about the data types SQLite can hold. I seem to recall that what you say was once

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Mark Morgan Lloyd
Sven Barth wrote: An important note about signal handlers: don't do anything complicated in them. Maybe just set a flag (e.g. SignalTerminated := True) and handle that in your application loop once control returned. Signals are executed from a different stack space and a different context and

Re: [Lazarus] Problem with zeos and sqlite-3

2013-02-16 Thread Michael Van Canneyt
On Sat, 16 Feb 2013, TonyMc wrote: On Fri, 15 Feb 2013 13:43:21 +0100 (CET), you wrote: You should use a real database instead of sqlite. sqlite is good only for storing strings. I don't know what you mean by a real database but you are wrong about the data types SQLite can hold. I seem

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Ludo Brands
If I'd need to guess than I'd say that this is the script executed by Slackware's init process if run level is 6. Yes, but I'm making the point that at least on that system it's not something implicit to init. Debian looks like it does it differently, but I'd imagine that the end result

Re: [Lazarus] Problem with zeos and sqlite-3

2013-02-16 Thread Sven Barth
Am 16.02.2013 13:28 schrieb Michael Van Canneyt mich...@freepascal.org: Furthermore, SQLite makes a good partner for FreePascal and Lazarus, so you should not discourage people here from using it. I strongly disagree it is a good partner. Object Pascal is a strongly typed language: FPC

Re: [Lazarus] Problem with zeos and sqlite-3

2013-02-16 Thread Michael Van Canneyt
On Sat, 16 Feb 2013, Sven Barth wrote: Am 16.02.2013 13:28 schrieb Michael Van Canneyt mich...@freepascal.org: Furthermore, SQLite makes a good partner for FreePascal and Lazarus, so you should not discourage people here from using it. I strongly disagree it is a good partner. Object

[Lazarus] Patch to use different resource-formats within the ide

2013-02-16 Thread Joost van der Sluis
Hi all, Maybe someone can have a look at the patch in http://bugs.freepascal.org/view.php?id=23814 . It adds the ability to register other resource-formats then the lfm-format inside the IDE. If we can agree on adding this feature, I can ask people to help testing the XIB-designer. Joost.

Re: [Lazarus] Problem with zeos and sqlite-3

2013-02-16 Thread Sven Barth
On 16.02.2013 13:58, Michael Van Canneyt wrote: On Sat, 16 Feb 2013, Sven Barth wrote: Am 16.02.2013 13:28 schrieb Michael Van Canneyt mich...@freepascal.org: Furthermore, SQLite makes a good partner for FreePascal and Lazarus, so you should not discourage people here from using it. I

Re: [Lazarus] Problem with zeos and sqlite-3

2013-02-16 Thread Michael Van Canneyt
On Sat, 16 Feb 2013, Sven Barth wrote: In our WinCE client for our application we use it for a miniature version of our database. As the client does not need all tables and only a specific subset of the data we generate a database on the host computer and download that to the device. When

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Hans-Peter Diettrich
Mark Morgan Lloyd schrieb: Sven Barth wrote: On 16.02.2013 09:22, Mark Morgan Lloyd wrote: On unix (Linux, Solaris etc.) is it possible to determine how a program written using Lazarus is being terminated? Specifically, is there any different behaviour when a kill signal arrives from a

Re: [Lazarus] Problem with zeos and sqlite-3

2013-02-16 Thread Sven Barth
On 16.02.2013 14:33, Michael Van Canneyt wrote: On Sat, 16 Feb 2013, Sven Barth wrote: In our WinCE client for our application we use it for a miniature version of our database. As the client does not need all tables and only a specific subset of the data we generate a database on the host

Re: [Lazarus] Problem with zeos and sqlite-3

2013-02-16 Thread Joost van der Sluis
In our WinCE client for our application we use it for a miniature version of our database. As the client does not need all tables and only a specific subset of the data we generate a database on the host computer and download that to the device. When the user is done the database is

Re: [Lazarus] Problem with zeos and sqlite-3

2013-02-16 Thread Sven Barth
On 16.02.2013 14:41, Joost van der Sluis wrote: In our WinCE client for our application we use it for a miniature version of our database. As the client does not need all tables and only a specific subset of the data we generate a database on the host computer and download that to the device.

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Andrew Brunner
On Feb 16, 2013, at 6:36 AM, Ludo Brands ludo.bra...@free.fr wrote: Debian has shuffled the names a bit but the principle is the same. /etc/init.d/rc calls eventually /etc/init.d/sendsigs and in that script you'll find killall5 -15 $OMITPIDS # SIGTERM followed a little later by killall5

Re: [Lazarus] Problem with zeos and sqlite-3

2013-02-16 Thread Frank Church
On 16 February 2013 13:51, Sven Barth pascaldra...@googlemail.com wrote: On 16.02.2013 14:41, Joost van der Sluis wrote: In our WinCE client for our application we use it for a miniature version of our database. As the client does not need all tables and only a specific subset of the data we

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread waldo kitty
On 2/16/2013 08:30, Hans-Peter Diettrich wrote: Procedures even may be different for Linux and Windows, depending on the signal/message types. Even if a program can ignore SIGTERM, can it also inform the system that it doesn't *want* to close? On Windows a program can stop an shutdown, maybe not

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Michael Van Canneyt
On Sat, 16 Feb 2013, waldo kitty wrote: On 2/16/2013 08:30, Hans-Peter Diettrich wrote: Procedures even may be different for Linux and Windows, depending on the signal/message types. Even if a program can ignore SIGTERM, can it also inform the system that it doesn't *want* to close? On

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Sven Barth
On 16.02.2013 18:27, waldo kitty wrote: On 2/16/2013 05:26, Sven Barth wrote: The reason for this first TERM then KILL approach is that an application could either hang (and thus not respond correctly to TERM if it has hooked it) or it could just ignore the TERM. So on shutdown the init system

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread waldo kitty
On 2/16/2013 12:43, Michael Van Canneyt wrote: On Sat, 16 Feb 2013, waldo kitty wrote: On 2/16/2013 08:30, Hans-Peter Diettrich wrote: Procedures even may be different for Linux and Windows, depending on the signal/message types. Even if a program can ignore SIGTERM, can it also inform the

Re: [Lazarus] Finding out how a program's being terminated

2013-02-16 Thread Henry Vermaak
On Sat, Feb 16, 2013 at 06:43:51PM +0100, Michael Van Canneyt wrote: On Sat, 16 Feb 2013, waldo kitty wrote: On 2/16/2013 08:30, Hans-Peter Diettrich wrote: Procedures even may be different for Linux and Windows, depending on the signal/message types. Even if a program can ignore SIGTERM, can

Re: [Lazarus] Getting a Field list of a record

2013-02-16 Thread Alejandro Gonzalo
You could use a variants instead of records, an enumeration list could keep track of the field names. Your user clause has to include variants.  Here is part of a procedure I used for another purpose:   var aRecord : variant;       i : integer; begin    for i := 0 to

Re: [Lazarus] Getting a Field list of a record

2013-02-16 Thread Alejandro Gonzalo
whoops, forgot you have to include this line before the for clause:    aRecord:= VarArrayCreate([0, Dataset.FieldCount-1], varVariant);   A. G; From: Alejandro Gonzalo parkingspac...@yahoo.com To: Lazarus mailing list lazarus@lists.lazarus.freepascal.org Sent:

[Lazarus] [ISSUE] Complete code error

2013-02-16 Thread silvioprog
Hello, Please see: http://bugs.freepascal.org/view.php?id=23903 Thank you! -- Silvio Clécio My public projects - github.com/silvioprog -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org