Re: [fpc-pascal] compile DPR files

2008-03-24 Thread Graeme Geldenhuys
On 24/03/2008, L <[EMAIL PROTECTED]> wrote: > I think fpc compiler should compile .dpr files without having to type > the extension.. me is lazy.. > > fpc prog > > this compiles prog.pp but doesn't do prog.dpr ;-) Like Arne said, use the Tab key completion feature. I don't know when last I typ

[fpc-pascal] classes initialization

2008-03-24 Thread L
Recently we discussed records and how to initialize them.. Jonas cleared up a lot for me (and Marco/Florian etc.). Thanks much.. So.. now I ask.. type something = class s: ansistring; int:integer end; Is "int" set to zero when it is a local scope var in a procedure created on the heap with C

Re: [fpc-pascal] compile DPR files

2008-03-24 Thread Arne Hanssen
L skrev: I think fpc compiler should compile .dpr files without having to type the extension.. me is lazy.. fpc prog this compiles prog.pp but doesn't do prog.dpr ;-) What do we think? Not answering your question, but if you really are lazy (and I'll you are using Windows, having this prob

Re: [fpc-pascal] Erlang/YAWS vs Free Pascal/Xitami

2008-03-24 Thread Jonas Maebe
On 24 Mar 2008, at 16:53, Jilani Khaldi wrote: Jilani Khaldi wrote: Which is better for my web application? http://www.dotpas/org/cgi-bin/articles/a01 Soory, the URL is: http://www.dotpas.org/cgi-bin/articles/a01 I guess the main problem is that you are writing Pascal in a way which is ver

Re: [fpc-pascal] Erlang/YAWS vs Free Pascal/Xitami

2008-03-24 Thread Jilani Khaldi
Jilani Khaldi wrote: Which is better for my web application? http://www.dotpas/org/cgi-bin/articles/a01 Soory, the URL is: http://www.dotpas.org/cgi-bin/articles/a01 -- *** Jilani KHALDI http://www.dotpas.org ___ fpc-pascal maillist - fpc-pascal@lis

[fpc-pascal] Erlang/YAWS vs Free Pascal/Xitami

2008-03-24 Thread Jilani Khaldi
Which is better for my web application? http://www.dotpas/org/cgi-bin/articles/a01 -- *** Jilani KHALDI http://www.dotpas.org ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: Initializing Records Automatically

2008-03-24 Thread Jonas Maebe
On 24 Mar 2008, at 14:10, L wrote: One thing to ponder about: A class inside a record... trecord = record something: TSomeClass; int: integer; //... etc end; My brain hurts. A class field is just a pointer. Since classes are not reference counted, nothing special is done for record fields

[fpc-pascal] Re: Initializing Records Automatically

2008-03-24 Thread L
One thing to ponder about: A class inside a record... trecord = record something: TSomeClass; int: integer; //... etc end; My brain hurts. This will cause issues with a Fillchar for the class, or not? I wouldn't use this normally (a class inside a record), but it is still interesting to th

[fpc-pascal] Re: Initializing Records Automatically

2008-03-24 Thread L
I think confusion was created also because that guys blog post only had a record with one field in it (a string).. he should have used more fields with integers, pointers, etc to demonstrate a point more. ___ fpc-pascal maillist - fpc-pascal@lists.

[fpc-pascal] compile DPR files

2008-03-24 Thread L
I think fpc compiler should compile .dpr files without having to type the extension.. me is lazy.. fpc prog this compiles prog.pp but doesn't do prog.dpr ;-) What do we think? I can supply patch and work on it if you think it is useful. p.s. I haven't checked, does fpc automatically compile

Re: [fpc-pascal] Re: Initializing Records Automatically

2008-03-24 Thread Marco van de Voort
> L wrote: > Ansistrings are initialized in the record? > But integers too? Only automated types are initialized/finalized, the rest not. So the blog post has a point, it is something to look out for. ___ fpc-pascal maillist - fpc-pascal@lists.freepasc

Re: [fpc-pascal] Initializing Records Automatically

2008-03-24 Thread Jonas Maebe
On 24 Mar 2008, at 12:03, ik wrote: Since when are you using fillchar on a string in Pascal ? that's a C approach. He's using it on a record. Initialising records with fillchar (regardless of what they contain) is quite common in Pascal as well. And as Florian mentioned, if you do this fo

[fpc-pascal] Re: Initializing Records Automatically

2008-03-24 Thread L
L wrote: Florian wrote.. Records and objects containing automated fields are initialized? Or do I miss something? Oh...? This is something I have never been clear about :-( p.s. see also: http://community.freepascal.org:1/bboards/message?message_id=223327&forum_id=24082 So. let's cle

Re: [fpc-pascal] Initializing Records Automatically

2008-03-24 Thread ik
Since when are you using fillchar on a string in Pascal ? that's a C approach. BTW Most Pascal's string functions will stop on the first #0 they encounter, at least the Delphi's tool that I remember. I think he misses the entire point in his blog. Ido On Mon, Mar 24, 2008 at 1:20 PM, L <[EMAIL

Re: [fpc-pascal] Re: Initializing Records Automatically

2008-03-24 Thread Jonas Maebe
On 24 Mar 2008, at 12:53, L wrote: So a record with an ansistring and an integer.. for example even local scope.. Will be all zeros? procedure test; var somerec: Tsomerec; begin // these checks are okay? if somerec.astring = '' if somerec.someint = 0 end; i.e. above is not random data?

[fpc-pascal] Re: Initializing Records Automatically

2008-03-24 Thread L
Florian wrote.. Records and objects containing automated fields are initialized? Or do I miss something? Oh...? This is something I have never been clear about :-( So a record with an ansistring and an integer.. for example even local scope.. Will be all zeros? procedure test; var somerec:

Re: [fpc-pascal] Initializing Records Automatically

2008-03-24 Thread Marco van de Voort
> L schrieb: > > > > Many times I find myself initializing stuff tediously and error prone > > when you do it a human way without automation. > > Records and objects containing automated fields are initialized? Are they? Or only the automated fields? __

[fpc-pascal] Re: Set ioresult

2008-03-24 Thread L
I wrote: and using fpFlock on windows. Typo: on unix ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Set ioresult

2008-03-24 Thread L
how to set it without writing a text driver plugin? There was something like SetInOutRes for delphi in some unit. Is global inoutres a threadvar, btw? Safe to set it directly as a global variable (eek.. should there be some function?) The docs say that it is "read only". http://www.freepasca

Re: [fpc-pascal] Initializing Records Automatically

2008-03-24 Thread Florian Klaempfl
L schrieb: > http://stanleyxu2005.blogspot.com/2008/01/potential-memory-leak-by-initializing.html > > > Interesting.. > > So with > > procedure InitRecord(out R; SizeOfRecord: Integer); > begin > FillChar(R, SizeOfRecord, #0); > end; > > Even if it has dynamic array, ansistrings, shortstrings

[fpc-pascal] Initializing Records Automatically

2008-03-24 Thread L
http://stanleyxu2005.blogspot.com/2008/01/potential-memory-leak-by-initializing.html Interesting.. So with procedure InitRecord(out R; SizeOfRecord: Integer); begin FillChar(R, SizeOfRecord, #0); end; Even if it has dynamic array, ansistrings, shortstrings, integers, I assume it is okay to i