Re: Re[4]: [fpc-pascal] TIniFile crash/memory loss

2011-03-31 Thread Bart
On 3/31/11, José Mejuto wrote: > B> This however means that the programmer has to protect TIniFile.Free > B> with a Try..Except block, which is also rather unusual. > > It's unusual, but there is an error, or the class does not perform the > save in the free procedure and uses a "flush" (forced) o

Re[4]: [fpc-pascal] TIniFile crash/memory loss

2011-03-31 Thread José Mejuto
Hello FPC-Pascal, Thursday, March 31, 2011, 6:52:26 PM, you wrote: B> This however means that the programmer has to protect TIniFile.Free B> with a Try..Except block, which is also rather unusual. It's unusual, but there is an error, or the class does not perform the save in the free procedure a

Re: [fpc-pascal] run pascal programs as scripts

2011-03-31 Thread Mattias Gaertner
On Thu, 31 Mar 2011 14:31:04 +0200 Darius Blaszyk wrote: > > On Mar 31, 2011, at 2:07 PM, michael.vancann...@wisa.be wrote: > > > Ok, last request: > > > > Please use the ExecuteProcess variant with an array of string as second > > parameter. > > > > Reason: as soon as a command-line argument

Re: Re[2]: [fpc-pascal] TIniFile crash/memory loss

2011-03-31 Thread Bart
This however means that the programmer has to protect TIniFile.Free with a Try..Except block, which is also rather unusual. Bart On 3/31/11, José Mejuto wrote: > Hello FPC-Pascal, > > Thursday, March 31, 2011, 5:05:35 PM, you wrote: > >>> Should I report this behaviour as a bug, or is it conside

Re[2]: [fpc-pascal] TIniFile crash/memory loss

2011-03-31 Thread José Mejuto
Hello FPC-Pascal, Thursday, March 31, 2011, 5:05:35 PM, you wrote: >> Should I report this behaviour as a bug, or is it considered "by design"? >> (My old Delphi does not support the CacheUpdates property, so I cannot >> test how it behaves in Delphi) mvwb> Please report it as a bug. Your fix pro

Re: [fpc-pascal] Re: Generics in Delphi mode?

2011-03-31 Thread bsquared
On Wed, Mar 30, 2011 at 7:38 PM, leledumbo wrote: > Can't wait? Just take the snapshots ;) > > -- > View this message in context: > http://free-pascal-general.1045716.n5.nabble.com/Generics-in-Delphi-mode-tp4272087p4272664.html > Sent from the Free Pascal - General mailing list archive at Nabble.

Re: [fpc-pascal] TIniFile crash/memory loss

2011-03-31 Thread michael . vancanneyt
On Thu, 31 Mar 2011, Bart wrote: When you use TIniFile with CacheUpdates := true, then when you free the TIniFile an error can occur if the component was unable to update the changes (in UpdateFile), this will then raise an exception, which in turn will lead to not calling inherited Destroy, t

[fpc-pascal] TIniFile crash/memory loss

2011-03-31 Thread Bart
When you use TIniFile with CacheUpdates := true, then when you free the TIniFile an error can occur if the component was unable to update the changes (in UpdateFile), this will then raise an exception, which in turn will lead to not calling inherited Destroy, thus leading to memory loss, which cann

[fpc-pascal] Re: run pascal programs as scripts [OT]

2011-03-31 Thread Lukasz Sokol
[THIS IS OFF TOPIC :) ] linux init scripts in Pascal, anyone :) L. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] run pascal programs as scripts

2011-03-31 Thread Darius Blaszyk
On Mar 31, 2011, at 2:07 PM, michael.vancann...@wisa.be wrote: > Ok, last request: > > Please use the ExecuteProcess variant with an array of string as second > parameter. > > Reason: as soon as a command-line argument with spaces in it is passed to > the script, your code will mangle the argum

Re: [fpc-pascal] run pascal programs as scripts

2011-03-31 Thread michael . vancanneyt
On Thu, 31 Mar 2011, Darius Blaszyk wrote: On Mar 31, 2011, at 10:37 AM, michael.vancann...@wisa.be wrote: Do yourself a favour, and use ExecuteProcess from the sysutils unit for your Exec routine. It has all you need. The use of pipes is not needed when running the program, it will only ser

[fpc-pascal] Re: run pascal programs as scripts

2011-03-31 Thread Lukasz Sokol
Hi, On 31/03/2011 10:06, Darius Blaszyk wrote: > > This simplifies things quite a bit. Thanks for the hint. Here's a new patch, > I also added a fix for the command line options issue. Should be alright now. > All examples work fine on win32. > > Darius I haven't tried to run that yet, but, w

Re: [fpc-pascal] run pascal programs as scripts

2011-03-31 Thread Darius Blaszyk
On Mar 31, 2011, at 10:37 AM, michael.vancann...@wisa.be wrote: > Do yourself a favour, and use ExecuteProcess from the sysutils unit for your > Exec routine. It has all you need. The use of pipes is not needed when > running the program, it will only seriously slow the running of the program. >

Re: [fpc-pascal] run pascal programs as scripts

2011-03-31 Thread michael . vancanneyt
On Thu, 31 Mar 2011, Darius Blaszyk wrote: On Mar 31, 2011, at 9:20 AM, michael.vancann...@wisa.be wrote: On Thu, 31 Mar 2011, Darius Blaszyk wrote: I created a patch to make instantFPC run on win32. To make the app run I implemented TProcess as windows does not understands fpexecv. Ev

Re: [fpc-pascal] run pascal programs as scripts

2011-03-31 Thread Darius Blaszyk
On Mar 31, 2011, at 9:20 AM, michael.vancann...@wisa.be wrote: > > > On Thu, 31 Mar 2011, Darius Blaszyk wrote: > >> I created a patch to make instantFPC run on win32. To make the app run I >> implemented TProcess as windows does not understands fpexecv. Even better >> would be to use TProces

Re: [fpc-pascal] run pascal programs as scripts

2011-03-31 Thread michael . vancanneyt
On Thu, 31 Mar 2011, Darius Blaszyk wrote: I created a patch to make instantFPC run on win32. To make the app run I implemented TProcess as windows does not understands fpexecv. Even better would be to use TProcess for all platforms, thus removing the need of defines and we could drop the uni