Re: [fpc-pascal] TStringList.InsertItem

2013-02-08 Thread Michael Van Canneyt
On Fri, 8 Feb 2013, Bart wrote: Hi, Consider: Procedure TStringList.InsertItem(Index: Integer; const S: string); and Procedure TStringList.InsertItem(Index: Integer; const S: string; O: TObject); 1018 Procedure TStringList.InsertItem(Index: Integer; const S: string); 1019 begin 1020

[fpc-pascal] GetCurrentThreadID under FreeBSD vs Linux

2013-02-08 Thread Graeme Geldenhuys
Hi, Under Linux and Windows I have the following code which works fine. var LThreadID: string; begin FmtStr(LThreadID, '%.4d', [GetCurrentThreadID]); Under FreeBSD (64-bit) that failed with a EConvertError in the unit tests and the compiler gave a message of 'Invalid argument index in

Re: [fpc-pascal] GetCurrentThreadID under FreeBSD vs Linux

2013-02-08 Thread Ewald
Hello, I had the exact same issue when writing debug info in my code. Easy to solve I think. Just define a macro at the top of the unit like this: {$macro on} {$define Debug_ThreadSelf:= ptruint(GetCurrentThreadID)} And then change all FmtStr lines to something like

Re: [fpc-pascal] TStringList.InsertItem

2013-02-08 Thread Bart
On 2/8/13, Michael Van Canneyt mich...@freepascal.org wrote: It could do that, feel free to provide a patch :) Done: http://bugs.freepascal.org/view.php?id=23860 Bart ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] GetCurrentThreadID under FreeBSD vs Linux

2013-02-08 Thread Sven Barth
Am 08.02.2013 18:09 schrieb Ewald ew...@yellowcouch.org: It can be that `ptruint` is defined in `unixtype`, but I don't know for sure. PtrUInt (and PtrInt) are declared in unit System. Regards, Sven ___ fpc-pascal maillist -

Re: [fpc-pascal] GetCurrentThreadID under FreeBSD vs Linux

2013-02-08 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said: Under Linux and Windows I have the following code which works fine. var LThreadID: string; begin FmtStr(LThreadID, '%.4d', [GetCurrentThreadID]); Threadids are probably opague under Posix. So while it works, it is not correct on Linux.

Re: [fpc-pascal] GetCurrentThreadID under FreeBSD vs Linux

2013-02-08 Thread Graeme Geldenhuys
On 2013-02-08 20:34, Marco van de Voort wrote: Navigating the code to see how TThreadID is defined, I found this for FreeBSD. TThreadRec = record end; TThreadID = ^TThreadRec; So TThreadID is just a pointer to a record structure This is a common construct to define opague types.

Re: [fpc-pascal] GetCurrentThreadID under FreeBSD vs Linux

2013-02-08 Thread Graeme Geldenhuys
On 2013-02-08 17:08, Ewald wrote: {$macro on} {$define Debug_ThreadSelf:= ptruint(GetCurrentThreadID)} I must confess I haven't used macros in FPC. Also the code I'm working with is cross platform and cross compiler. I don't know if Delphi supports such macros. Quick search in Delphi 7

[fpc-pascal] Fpc Access Violation if AppConfigDir doesn't exist.

2013-02-08 Thread Giuliano Colla
Launching a Lazarus application in a freshly installed Linux system, I found a condition which may be quite confusing for a normal user: the main form was shown, the program didn't work, and there was no way to close the form, which could only be closed by a killall from command line.

Re: [fpc-pascal] Re: what happened to the contributed units listing?

2013-02-08 Thread Frank Church
On 7 February 2013 21:23, Michael Van Canneyt mich...@freepascal.org wrote: On Thu, 7 Feb 2013, Frank Church wrote: On 7 February 2013 12:35, leledumbo leledumbo_c...@yahoo.co.id wrote: Bye2 PHP based list, welcome fpweb + ExtJS based list :) -- Do we get the chance to view the code

[fpc-pascal] Re: Fpc Access Violation if AppConfigDir doesn't exist.

2013-02-08 Thread Reinier Olislagers
On 9-2-2013 1:49, Giuliano Colla wrote: It turned out that the reason was simply that the default AppConfigDir (~/.config/ ) wasn't there, and therefore in the two usual lines AppConfigFileName:= GetAppConfigFile(False); ini := TIniFile.Create(AppConfigFileName); the second line was