[fpc-pascal] Re: More fun with dynamic arrays

2011-11-18 Thread leledumbo
The correct results are obtained if > 1) I substitute "Var" for "Out". This leads to the warning that X is not initialized. "var" could be used to treat the parameter as in-out, so the warning is expected if you haven't initialized the variable before. As stated in the docs (http://www.freepasc

Re: [fpc-pascal] using functions from units & main programme

2011-11-18 Thread Bart
On 11/18/11, Sven Barth wrote: > But he wants to call "fnb" in the main program and have that call "fna" > of the main program instead of "fna" from "jim". You're right. I misread the original post. Bart ___ fpc-pascal maillist - fpc-pascal@lists.fr

Re: [fpc-pascal] Convert unix timestamp to TDateTime

2011-11-18 Thread José Mejuto
Hello FPC-Pascal, Friday, November 18, 2011, 1:54:13 PM, you wrote: SG>I would like to convert a unix timestamp to TDateTime taking into SG> account timezone and daylight savings. For example, timestamp: SG> 1308666350 should be converted to: 2011/06/21 16:25:50, assuming GMT+1 SG> timezone i

Re: [fpc-pascal] using functions from units & main programme

2011-11-18 Thread Bernd
2011/11/18 John Lee : > Never seen this before - is there a way I can force fnb to use the main > program's version of fna, not the version that's in the unit? > TIA John Your problem sounds very much like you would really want to make use of objects, inheritance and virtual methods. Instead of pa

Re: [fpc-pascal] JSON - RTTI streaming.

2011-11-18 Thread Sven Barth
On 18.11.2011 19:57, Stephane Carre wrote: Finally, I also found the original testcomps.pp file in the sources (and at the sime time I discovered a limitation of the Windows 7 file search tool, which was why I did not find the file before). That's a reason to use the file search of some editor

Re: [fpc-pascal] using functions from units & main programme

2011-11-18 Thread Sven Barth
On 18.11.2011 18:15, Bart wrote: {file: prog.pas} Program Prog; {$ifdef fpc} {$mode objfpc}{h+} {$endif} uses jim; function fna: string; begin fna := 'Prog'; end; begin writeln('fna = ',fna); writeln('jim.fna = ,'jim.fna); end. Compiled with both TurboPascal 6.0 and fpc 2.4.4. the

Re: [fpc-pascal] using functions from units & main programme

2011-11-18 Thread Alberto Narduzzi
Thanks for the fix, but it makes the code a bit more complicated than I'd hoped/thought based on my (over simple?) impression that local fns are used in place of those in units. John this would be true if you declared another function fnb locally, so that calling fnb could eventually override t

Re: [fpc-pascal] JSON - RTTI streaming.

2011-11-18 Thread Stephane Carre
Hello Michael, Finally, I also found the original testcomps.pp file in the sources (and at the sime time I discovered a limitation of the Windows 7 file search tool, which was why I did not find the file before). As indicated below, the version that comes with the sources is not complete. I mod

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

2011-11-18 Thread Bart
On 11/16/11, Tomas Hajny wrote: > Indeed - TP/BP 7.0 gives the same (error) result. Unit strings (which > might be more appropriate than unit objects included by Bart) doesn't > change the result either. Getting really Off-Topic ;-) PChar is defined in objects unit in TP6, there is no strings un

Re: [fpc-pascal] using functions from units & main programme

2011-11-18 Thread Bart
{file: jim.pas} unit jim; {$ifdef fpc} {$mode objfpc}{h+} {$endif} interface function fna: string; function fnb: string; implementation function fna: string; begin fna := 'jim'; end; function fnb: string; begin fnb := fna; end; end. {file: prog.pas} Program Prog; {$ifdef fpc} {$mod

Re: [fpc-pascal] using functions from units & main programme

2011-11-18 Thread John Lee
Thanks for the fix, but it makes the code a bit more complicated than I'd hoped/thought based on my (over simple?) impression that local fns are used in place of those in units. John On 18 November 2011 16:55, Sven Barth wrote: > Am 18.11.2011 17:47, schrieb John Lee: > > Sorry for confusion, m

Re: [fpc-pascal] using functions from units & main programme

2011-11-18 Thread Sven Barth
Am 18.11.2011 17:47, schrieb John Lee: Sorry for confusion, my email wasn't clear... old fpc version, that I have to use because of availability of various units...Free Pascal Compiler version 2.2.2 [2008/08/03] for i386 this is jim.pp--- unit jim; interface function fna:string; function fnb

Re: [fpc-pascal] using functions from units & main programme

2011-11-18 Thread John Lee
Sorry for confusion, my email wasn't clear... old fpc version, that I have to use because of availability of various units...Free Pascal Compiler version 2.2.2 [2008/08/03] for i386 this is jim.pp--- unit jim; interface function fna:string; function fnb:string; implementation function fna:strin

Re: [fpc-pascal] using functions from units & main programme

2011-11-18 Thread Sven Barth
Am 18.11.2011 16:49, schrieb John Lee: I have a normal fpc unit, call it jim, with 2 functions fna & fnb . fnb uses internally fna. My main program, has a uses clause including jim, and also a _different_ version of fna, with same parameters as for that in jim, but no fnb. The problem I get is

Re: [fpc-pascal] using functions from units & main programme

2011-11-18 Thread Sven Barth
Am 18.11.2011 16:49, schrieb John Lee: I have a normal fpc unit, call it jim, with 2 functions fna & fnb . fnb uses internally fna. My main program, has a uses clause including jim, and also a _different_ version of fna, with same parameters as for that in jim, but no fnb. The problem I get is

[fpc-pascal] using functions from units & main programme

2011-11-18 Thread John Lee
I have a normal fpc unit, call it jim, with 2 functions fna & fnb . fnb uses internally fna. My main program, has a uses clause including jim, and also a _different_ version of fna, with same parameters as for that in jim, but no fnb. The problem I get is that when, in main program fnb doesn't us

Re: [fpc-pascal] JSON - RTTI streaming.

2011-11-18 Thread Stephane Carre
Thank you Michael. I checked before in the fpc source 2.4.4 download available from sourceforge, but could not find testcomps anywhere. The version you attached does not contain TVariantComponent. Is that a newer, or older version than the one that should match fpc 2.4.4 ? Otherwise I guess I c

[fpc-pascal] Convert unix timestamp to TDateTime

2011-11-18 Thread Stathis Gkotsis
Hello, I would like to convert a unix timestamp to TDateTime taking into account timezone and daylight savings. For example, timestamp: 1308666350 should be converted to: 2011/06/21 16:25:50, assuming GMT+1 timezone in the winter (GMT+2 in the summer). I would like this conversion to work both

Re: [fpc-pascal] Makeskel generation question

2011-11-18 Thread Reinier Olislagers
On 18-11-2011 13:14, Michael Van Canneyt wrote: > On Fri, 18 Nov 2011, Reinier Olislagers wrote: >> >> >> >> >> >> Shouldn't the TIBConnection.GetHandle.Result function result visibility >> be protected as well? > > No, why ? A function result has no visibility. > The comment is just a hint fo

Re: [fpc-pascal] JSON - RTTI streaming.

2011-11-18 Thread Michael Van Canneyt
It is attached. It is committed, but probably not where you expected it :-) Michael. On Fri, 18 Nov 2011, Stephane Carre wrote: Hello Michael, I have not received any e-mail with the testcomps unit. Can you please make sure you send it to me ? Thanks for your time ! Regards, Stephane Carre

Re: [fpc-pascal] Makeskel generation question

2011-11-18 Thread Michael Van Canneyt
On Fri, 18 Nov 2011, Reinier Olislagers wrote: Hi list, I've run makeskel on ibconnection.pp. This declaration: protected ... function GetHandle : pointer; override; gets output as: Shouldn't the TIBConnection.GetHandle.Result function result visibility be protected as w

Re: [fpc-pascal] Makeskel generation question

2011-11-18 Thread Reinier Olislagers
On 18-11-2011 12:23, Graeme Geldenhuys wrote: > On 2011-11-18 13:15, Reinier Olislagers wrote: >> >> So apparently no help for the poor developer who wants to inherit a >> class and wants to figure out how to use the protected methods & >> properties ;) > > The is also no help (near zero) for poor

Re: [fpc-pascal] Makeskel generation question

2011-11-18 Thread Graeme Geldenhuys
On 2011-11-18 13:15, Reinier Olislagers wrote: > > So apparently no help for the poor developer who wants to inherit a > class and wants to figure out how to use the protected methods & > properties ;) The is also no help (near zero) for poor Michael, having to write all that documentation. Just

Re: [fpc-pascal] Makeskel generation question

2011-11-18 Thread Reinier Olislagers
On 18-11-2011 11:13, Graeme Geldenhuys wrote: > For the FPC documentation, only Public and Published methods & > properties are documented. So you should have generated the initial xml > file specifying only Public or higher visibility in the output makeskel > generates. > So apparently no help f

Re: [fpc-pascal] Makeskel generation question

2011-11-18 Thread Graeme Geldenhuys
On 2011-11-18 12:05, Reinier Olislagers wrote: > > Shouldn't the TIBConnection.GetHandle.Result function result visibility > be protected as well? I have no idea what "default" visibility actually means. I can add that parameters and function results don't generate any visibility headers in the d

[fpc-pascal] Makeskel generation question

2011-11-18 Thread Reinier Olislagers
Hi list, I've run makeskel on ibconnection.pp. This declaration: protected ... function GetHandle : pointer; override; gets output as: Shouldn't the TIBConnection.GetHandle.Result function result visibility be protected as well? I understand that the function result is... l

Re: [fpc-pascal] JSON - RTTI streaming.

2011-11-18 Thread Stephane Carre
Hello Michael, I have not received any e-mail with the testcomps unit. Can you please make sure you send it to me ? Thanks for your time ! Regards, Stephane Carre On 17/11/2011 09:16, michael.vancann...@wisa.be wrote: On Wed, 16 Nov 2011, Stephane Carre wrote: Hello Michael, In the current s