[fpc-pascal] Re: RE : SQLDB Firebird port other than 3050

2011-11-15 Thread Reinier Olislagers
On 15-11-2011 16:30, Ludo Brands wrote: >>> How do I specify the port number when connecting to >> Firebird/Interbase >>> databases with sqldb on a different port than the default (3050)? >> >> Try >>/portnr:/path/to/database >> in your databasename. > host/port:c:\...\data.fdb > http://www.d

RE : [fpc-pascal] SQLDB Firebird port other than 3050

2011-11-15 Thread Ludo Brands
> > > Hi all, > > > > This is probably my confused week, but I couldn't find any > > documentation. > > > > How do I specify the port number when connecting to > Firebird/Interbase > > databases with sqldb on a different port than the default (3050)? > > Try >/portnr:/path/to/database > in

Re: [fpc-pascal] SQLDB Firebird port other than 3050

2011-11-15 Thread michael . vancanneyt
On Tue, 15 Nov 2011, Reinier Olislagers wrote: Hi all, This is probably my confused week, but I couldn't find any documentation. How do I specify the port number when connecting to Firebird/Interbase databases with sqldb on a different port than the default (3050)? Try /portnr:/path/to/d

[fpc-pascal] SQLDB Firebird port other than 3050

2011-11-15 Thread Reinier Olislagers
Hi all, This is probably my confused week, but I couldn't find any documentation. How do I specify the port number when connecting to Firebird/Interbase databases with sqldb on a different port than the default (3050)? Thanks, Reinier ___ fpc-pascal ma

Re: [fpc-pascal] pchar with more than 255 characters

2011-11-15 Thread Jonas Maebe
On 14 Nov 2011, at 22:08, Felipe Monteiro de Carvalho wrote: > On Sun, Nov 13, 2011 at 1:39 AM, Rainer Stratmann > wrote: >> procedure getchars( p : pchar ); >> var l : longint; >> begin >> l := length( p ); >> end; > > You cannot do length in a PChar length(pchar) is translated into strlen(p

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-15 Thread Sven Barth
Am 15.11.2011 10:39, schrieb Graeme Geldenhuys: On 15/11/2011, Sven Barth wrote: In this case the reason is simply backwards compatibilty (note: not Delphi compatibilty :P ). But that's my point. I really don't think anybody is writing TP style programs any more. So wouldn't it make sense to

Re: [fpc-pascal] various ways of passing a class instance as a parameter

2011-11-15 Thread Martin Schreiber
On Tuesday 15 November 2011 11.00:34 Graeme Geldenhuys wrote: > >> procedure foo(const AClass: TStringList); > > > > Take a copy of the AClass instance pointer, AClass is readonly. > > This one confused me a bit. I thought the whole object would be > read-only, but in fact it is just the AClass

Re: [fpc-pascal] various ways of passing a class instance as a parameter

2011-11-15 Thread Graeme Geldenhuys
On 15/11/2011, Martin Schreiber wrote: > Thanks Martin. Extending my example by changing the body of foo() too... AClass.Free; AClass := TStringList.Create; AClass.Add('inside foo'); ...reveals a bit more about the differences. >> procedure foo(const AClass: TStringList); >> > Take a c

Re: [fpc-pascal] various ways of passing a class instance as a parameter

2011-11-15 Thread Martin Schreiber
On Tuesday 15 November 2011 10.33:13 Graeme Geldenhuys wrote: > Hi, > > What exactly is the difference (if any) between the parameter modifier > when you pass a class instance to a procedure? > > In the example below, I can define foo() as follows... > > procedure foo(AClass: TStringList); > o

Re: [fpc-pascal] various ways of passing a class instance as a parameter

2011-11-15 Thread michael . vancanneyt
On Tue, 15 Nov 2011, Graeme Geldenhuys wrote: Hi, What exactly is the difference (if any) between the parameter modifier when you pass a class instance to a procedure? It behaves exactly the same as if you would pass a typed pointer. Michael. ___

Re: [fpc-pascal] various ways of passing a class instance as a parameter

2011-11-15 Thread Alexander Shishkin
15.11.2011 13:33, Graeme Geldenhuys пишет: Hi, What exactly is the difference (if any) between the parameter modifier when you pass a class instance to a procedure? I your example there is no difference, except that "var" could be ~0.01% slower _

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-15 Thread Graeme Geldenhuys
On 15/11/2011, Sven Barth wrote: > In this case the reason is simply backwards compatibilty (note: not Delphi > compatibilty :P ). But that's my point. I really don't think anybody is writing TP style programs any more. So wouldn't it make sense to change the default for the vast majority or pro

[fpc-pascal] various ways of passing a class instance as a parameter

2011-11-15 Thread Graeme Geldenhuys
Hi, What exactly is the difference (if any) between the parameter modifier when you pass a class instance to a procedure? In the example below, I can define foo() as follows... procedure foo(AClass: TStringList); or procedure foo(var AClass: TStringList); or procedure foo(const AClass: TStri

Re: [fpc-pascal] parent class as a parameter type

2011-11-15 Thread Graeme Geldenhuys
On 15/11/2011, Felipe Monteiro de Carvalho wrote: > On Tue, Nov 15, 2011 at 10:10 AM, Bart wrote: >> That would be strange indeed, because then most events (onclick >> handlers etc) would not compile anymore, since they are in the format >> procedure(Sender: TObject) of object... > > It is not li

Re: [fpc-pascal] parent class as a parameter type

2011-11-15 Thread Felipe Monteiro de Carvalho
On Tue, Nov 15, 2011 at 10:10 AM, Bart wrote: > That would be strange indeed, because then most events (onclick > handlers etc) would not compile anymore, since they are in the format > procedure(Sender: TObject) of object... It is not like that, he forgot adding var or out to the parameter. The

Re: [fpc-pascal] parent class as a parameter type

2011-11-15 Thread Bart
On 12.11.2011 22:18, ik wrote: > Since 2.6.0, when you write something like this: > > procedure foo(AClass : TStrings); > foo(MyStringList); // Will return an error that TStrings is expected ... > That would be strange indeed, because then most events (onclick handlers etc) would not compile anymo

Re: [fpc-pascal] Makeskel error or error behind keyboard?

2011-11-15 Thread Reinier Olislagers
On 15-11-2011 9:50, michael.vancann...@wisa.be wrote: > On Tue, 15 Nov 2011, Sven Barth wrote: >> Am 14.11.2011 17:11, schrieb Reinier Olislagers: >>> Snippet of the code in question: >>>TCustomXMLXSDExporter = class(TCustomFileExporter) >>>const >>> DefaultDatasetName = 'Table1';<

Re: [fpc-pascal] CloseThread needed? still unclear

2011-11-15 Thread Sven Barth
Am 14.11.2011 02:32, schrieb nore...@z505.com: First I thought I would post this to the mailing list to ask you what the proper way to program with threads is. If we must call closethread on MS Win machines but not unix machines, then something needs to change to make the threading in the RTL mor

Re: [fpc-pascal] Makeskel error or error behind keyboard?

2011-11-15 Thread michael . vancanneyt
On Tue, 15 Nov 2011, Sven Barth wrote: Am 14.11.2011 17:11, schrieb Reinier Olislagers: Snippet of the code in question: { TCustomXMLXSDExporter } TCustomXMLXSDExporter = class(TCustomFileExporter) const DefaultDatasetName = 'Table1';<== this is where it bombs // Na

Re: [fpc-pascal] Makeskel error or error behind keyboard?

2011-11-15 Thread Sven Barth
Am 14.11.2011 17:11, schrieb Reinier Olislagers: Snippet of the code in question: { TCustomXMLXSDExporter } TCustomXMLXSDExporter = class(TCustomFileExporter) const DefaultDatasetName = 'Table1';<== this is where it bombs // Name used for the exported table/dataset if n

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-15 Thread Sven Barth
Am 13.11.2011 17:49, schrieb Graeme Geldenhuys: On 13/11/2011, leledumbo wrote: I think the compiler treats functions receiving array of char (or pointer to it) as ShortString when none of the directives above exist. Indeed, FPC defaults to ShortString if {$H+} is not specified. That is proba