Re: [fpc-pascal] [OT] Sven, don't defect to the dark side!

2013-03-13 Thread Sven Barth
Am 12.03.2013 21:48 schrieb Sven Barth pascaldra...@googlemail.com: First and foremost: this is very offtopic, so I'm moving this over to fpc-other. If someone answers to my mail, then please ensure that you only answer to fpc-pascal. Thank you. Of course I meant only answer to fpc-other. I

[fpc-pascal] Randomly project fails to link under FreeBSD

2013-03-13 Thread Graeme Geldenhuys
Hi, I'm using FPC 2.7.1 under 64-bit FreeBSD 9.1. I have to use 2.7.1 (updated about a week ago), so I could get the fixes for threading and memory corruption under FreeBSD (disussed a while back on mailing list). Anyway, every now and again my projects (a few of them) fail to link as follows

[fpc-pascal] two questions about dynamic array

2013-03-13 Thread Xiangrong Fang
Hi All, I have two simple questions: 1) As far as I know class variables in FPC are automatic initialize to the NULL value (e.g. 0 or or whatever), does that include dynamic arrays? e.g. TMyClass = class myarray: array[0..100] of Integer; end; will myarray be initialized to nil? 2)

[fpc-pascal] Re: two questions about dynamic array

2013-03-13 Thread Xiangrong Fang
Sorry the array should be dynamic, without [0..100]. 2013/3/12 Xiangrong Fang xrf...@gmail.com Hi All, I have two simple questions: 1) As far as I know class variables in FPC are automatic initialize to the NULL value (e.g. 0 or or whatever), does that include dynamic arrays? e.g.

[fpc-pascal] Selective Class Helper

2013-03-13 Thread Xiangrong Fang
Hi There, Is it possible for class helpers to be selective? i.e. attach to a specific object of that class, but not every instance? This would be useful for behavior injection. Thanks ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Re: two questions about dynamic array

2013-03-13 Thread Howard Page-Clark
On 12/03/13 8:30, Xiangrong Fang wrote: TMyClass = class myarray: array[0..100] of Integer; end; You could answer such questions yourself: program Project1; {$mode objfpc} type TMyClass = class myarray: array of Integer; end; var my:TMyClass; begin my:=TMyClass.Create; try

Re: [fpc-pascal] Re: two questions about dynamic array

2013-03-13 Thread Sven Barth
Am 13.03.2013 10:08 schrieb Xiangrong Fang xrf...@gmail.com: Sorry the array should be dynamic, without [0..100]. Yes, in that case it will be Nil (Note: in the static case the elements of the array would be 0). Regards, Sven ___ fpc-pascal

Re: [fpc-pascal] two questions about dynamic array

2013-03-13 Thread Sven Barth
Am 13.03.2013 10:08 schrieb Xiangrong Fang xrf...@gmail.com: 2) After SetLength(myarray, 0), is myarray nil or pointing to some invalid address? It will be Nil. An equivalent alternative would be: MyArray := Nil; Regards, Sven ___ fpc-pascal maillist

Re: [fpc-pascal] Selective Class Helper

2013-03-13 Thread Sven Barth
Am 13.03.2013 10:09 schrieb Xiangrong Fang xrf...@gmail.com: Hi There, Is it possible for class helpers to be selective? i.e. attach to a specific object of that class, but not every instance? This would be useful for behavior injection. No, this is not possible. Regards, Sven

Re: [fpc-pascal] Re: two questions about dynamic array

2013-03-13 Thread Xiangrong Fang
Yes, in that case it will be Nil (Note: in the static case the elements of the array would be 0). So, it is even OK to use SetLength() on static arrays? interesting. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Re: two questions about dynamic array

2013-03-13 Thread Mattias Gaertner
On Wed, 13 Mar 2013 09:35:43 + Howard Page-Clark h...@talktalk.net wrote: On 12/03/13 8:30, Xiangrong Fang wrote: TMyClass = class myarray: array[0..100] of Integer; end; You could answer such questions yourself: Not with this simple test. [...] my:=TMyClass.Create;

Re: [fpc-pascal] two questions about dynamic array

2013-03-13 Thread Xiangrong Fang
2013/3/13 Sven Barth pascaldra...@googlemail.com Am 13.03.2013 10:08 schrieb Xiangrong Fang xrf...@gmail.com: 2) After SetLength(myarray, 0), is myarray nil or pointing to some invalid address? It will be Nil. An equivalent alternative would be: MyArray := Nil; Sorry, I didn't see this

Re: [fpc-pascal] Re: two questions about dynamic array

2013-03-13 Thread Howard Page-Clark
On 13/03/13 9:50, Mattias Gaertner wrote: On Wed, 13 Mar 2013 09:35:43 + Howard Page-Clark h...@talktalk.net wrote: On 12/03/13 8:30, Xiangrong Fang wrote: TMyClass = class myarray: array[0..100] of Integer; end; You could answer such questions yourself: Not with this simple

Re: [fpc-pascal] fpweb: processing URLs like GET http://server/cgi-bin/tigercgi/documents/301/

2013-03-13 Thread Reinier Olislagers
On 25-2-2013 13:38, Michael Van Canneyt wrote: On Mon, 25 Feb 2013, Reinier Olislagers wrote: As soon as the path has more than 1 component, it is assumed that the path is composed of /module/action/whatever. If - and only if - there is only 1 path component, it is assumed to be an action:

[fpc-pascal] FPC / Lazarus ARM Embedded Debuging

2013-03-13 Thread Justin Smyth
Sorry of this cross posts but i wasn't sure where to send this question to. I am currently using a LPC 1343 Microprocessor board and i have recently purchased a ULINK2 debugging kit from china. i am aware that there are plans to allow debugging these boards using the UNLINK2, but it wasnt

Re: [fpc-pascal] Re: two questions about dynamic array

2013-03-13 Thread Sven Barth
Am 13.03.2013 10:45 schrieb Xiangrong Fang xrf...@gmail.com: Yes, in that case it will be Nil (Note: in the static case the elements of the array would be 0). So, it is even OK to use SetLength() on static arrays? interesting. No, I meant that the content of a static array will be

Re: [fpc-pascal] two questions about dynamic array

2013-03-13 Thread Sven Barth
Am 13.03.2013 10:53 schrieb Xiangrong Fang xrf...@gmail.com: 2013/3/13 Sven Barth pascaldra...@googlemail.com Am 13.03.2013 10:08 schrieb Xiangrong Fang xrf...@gmail.com: 2) After SetLength(myarray, 0), is myarray nil or pointing to some invalid address? It will be Nil. An equivalent

Re: [fpc-pascal] differences between .pp and .pas files

2013-03-13 Thread Zaher Dirkey
I am using pas for units that Delphi compatible you can compile it with Delphi, now pp it is only FPC compiled not compatible with Delphi. On Mon, Feb 25, 2013 at 7:34 AM, Eric Kom eric...@metropolitancollege.co.za wrote: Good day, Please what is a difference between .pp and .pas files

[fpc-pascal] Re: Selective Class Helper

2013-03-13 Thread leledumbo
That would change the class model to prototyping (as in Lua, JavaScript, etc.), which is not how it's implemented in Object Pascal... -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Selective-Class-Helper-tp5713531p5713545.html Sent from the Free Pascal -

Re: [fpc-pascal] Randomly project fails to link under FreeBSD

2013-03-13 Thread Graeme Geldenhuys
On 2013-03-11 17:32, Graeme Geldenhuys wrote: Anyway, every now and again my projects (a few of them) fail to link as follows Problem solved! I had a program unit named m2compiler.lpr, and in another directory I had a unit named M2Compiler.pas. This caused the conflict at linking. Simply

Re: [fpc-pascal] differences between .pp and .pas files

2013-03-13 Thread Graeme Geldenhuys
On 2013-02-25 05:34, Eric Kom wrote: Please what is a difference between .pp and .pas files extension? And what is interesting, is that FP Text IDE (which looks like Turbo Pascal IDE) defaults to the .pas extension when creating new units. You would think being so closely related to Free

Re: [fpc-pascal] Re: Selective Class Helper

2013-03-13 Thread Sven Barth
Am 13.03.2013 17:04 schrieb leledumbo leledumbo_c...@yahoo.co.id: That would change the class model to prototyping (as in Lua, JavaScript, etc.), which is not how it's implemented in Object Pascal... I would more call it Traits which is at least a feature I'd like to research. This means that

[fpc-pascal] catch segfaults

2013-03-13 Thread Xiangrong Fang
Is it possible to use try...except to catch SIGSEGV? Thanks! ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] catch segfaults

2013-03-13 Thread Ewald
Once upon a time, Xiangrong Fang said: Is it possible to use try...except to catch SIGSEGV? I don't know if it is possible, but how about using fpSignal()? See http://www.freepascal.org/docs-html/rtl/baseunix/fpsignal.html -- Ewald ___ fpc-pascal

Re: [fpc-pascal] catch segfaults

2013-03-13 Thread Xiangrong Fang
The document said it is deprecated? Also, I want this to be cross platform, not for unix only. The use case is: try buf := GetMemory(1024); size := 10240; stream.Read(buf^, size); except ?? end; 2013/3/14 Ewald ew...@yellowcouch.org Once upon a time, Xiangrong Fang said: Is it

Re: [fpc-pascal] Re: Selective Class Helper

2013-03-13 Thread Xiangrong Fang
I vote for Traits. This will make FP more flexible... As a matter of fact, I was surprised to see operator overloading being implemented in pascal, which was a feature I like in C++, although I have never write a program more complex than cout Hello World in that magnificent language. :-)

[fpc-pascal] about reference-counted variables

2013-03-13 Thread Xiangrong Fang
Is there a complete list of reference counted variables in FP? e.g. dynamic arrays are ref-counted. but are variables allocated by New() ref-counted? My use case is: type PMyRecord = ^TMyRecord; p: = New(PMyRecord); MyListView.Item[0].Data = p; MyListView.Item[0].Delete; -- Do I need to