Re: [fpc-pascal] FPC 2.6.2 for DOS/Go32V2 FP.EXE cannot run a second time

2013-09-17 Thread Tomas Hajny
On Tue, September 17, 2013 20:57, Lubomír Čabla wrote: > FPC 2.6.2 for DOS/Go32V2 > > There is the fatal IDE unstability in FPC 2.6.2 under pure DOS. > > IDE almost always starts only first time (after installation or reboot). > I start the IDE, compile and run the program (e.g. Hello.pas) and clos

Re: [fpc-pascal] FPC GO32 2.6.2 wrong result from SecondsBetween

2013-09-17 Thread Tomas Hajny
On Tue, September 17, 2013 20:51, Lubomír Čabla wrote: > Yes, I know, you are right, so far I've used DOS utility GetDate/GetTime > without any errors. > > I wanted to update the old compiler 1.x to the new version, but it seems > will stay with the old version. There should be no problem to conti

[fpc-pascal] Re: Generic TFPGList gives me compiler error: Operator is not overloaded

2013-09-17 Thread leledumbo
> and that operators can be used inside records I just knew this one :) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Generic-TFPGList-Record-Type-gives-me-compiler-error-Operator-is-not-overloaded-tp5716520p5716541.html Sent from the Free Pascal - General m

[fpc-pascal] FPC 2.6.2 for DOS/Go32V2 FP.EXE cannot run a second time

2013-09-17 Thread Lubomír Čabla
FPC 2.6.2 for DOS/Go32V2 There is the fatal IDE unstability in FPC 2.6.2 under pure DOS. IDE almost always starts only first time (after installation or reboot). I start the IDE, compile and run the program (e.g. Hello.pas) and close IDE. But when I want to start IDE again it crashes with SIGSEGV

Re: [fpc-pascal] FPC GO32 2.6.2 wrong result from SecondsBetween

2013-09-17 Thread Lubomír Čabla
Yes, I know, you are right, so far I've used DOS utility GetDate/GetTime without any errors. I wanted to update the old compiler 1.x to the new version, but it seems will stay with the old version. Thank you for your help. On Tue, Sep 17, 2013 at 8:31 PM, Tomas Hajny wrote: > On Tue, Septemb

Re: [fpc-pascal] Object constructor

2013-09-17 Thread Florian Klämpfl
Am 17.09.2013 09:44, schrieb Xiangrong Fang: > My question is, since the programmer is responsible for > explicitly call object constructors, then why do we need > constructors at all? In another word, what's the difference > between an object constructor and an obj

Re: [fpc-pascal] FPC GO32 2.6.2 wrong result from SecondsBetween

2013-09-17 Thread Tomas Hajny
On Tue, September 17, 2013 20:22, Lubomír Čabla wrote: > It may be, but I tried to use EncodeDateTime with the same result: > > DT1:=EncodeDateTime(2013,5,28,15,26,1,0); > DT2:=EncodeDateTime(2013,5,28,15,27,1,0); > > Function EncodeDateTime calls TryEncodeDateTime that uses TryEncodeDate > and > T

Re: [fpc-pascal] FPCUnit test + raise E;

2013-09-17 Thread Sven Barth
On 17.09.2013 17:18, Marcos Douglas wrote: I implemented -- but not up to Git yet -- some like that: procedure TghSQLHandler.DoOnException(E: Exception); var NewEx: EghSQLError; begin if Assigned(FOnException) then FOnException(Self, E) else begin NewEx := EghSQLError.

Re: [fpc-pascal] FPC GO32 2.6.2 wrong result from SecondsBetween

2013-09-17 Thread Lubomír Čabla
It may be, but I tried to use EncodeDateTime with the same result: DT1:=EncodeDateTime(2013,5,28,15,26,1,0); DT2:=EncodeDateTime(2013,5,28,15,27,1,0); Function EncodeDateTime calls TryEncodeDateTime that uses TryEncodeDate and TryEncodeTime. This is only a test, I want to be sure that after comp

Re: [fpc-pascal] Generic TFPGList gives me compiler error: Operator is not overloaded

2013-09-17 Thread Sven Barth
On 17.09.2013 17:39, Dennis Poon wrote: Sven, Thanks a lot. It worked. Generics, advanced record, customized operator ... all these new features are so cool. I am impressed that Free Pascal has become so powerful. At least generics and operator overloads aren't that new. What's new is that g

Re: [fpc-pascal] FPCUnit test + raise E;

2013-09-17 Thread Sven Barth
On 17.09.2013 17:27, Marcos Douglas wrote: On Tue, Sep 17, 2013 at 12:18 PM, Marcos Douglas wrote: Another thing you could try (just for testing): change your exception handler procedure to a function that returns bool and use it like this: === code begin === procedure TghSQLConnector.Connec

Re: [fpc-pascal] Generic TFPGList gives me compiler error: Operator is not overloaded

2013-09-17 Thread Dennis Poon
Sven, Thanks a lot. It worked. Generics, advanced record, customized operator ... all these new features are so cool. I am impressed that Free Pascal has become so powerful. Dennis uses fgl; Type RScene=record ID : Word; Name, Category : String; end; TSceneList=special

Re: [fpc-pascal] FPC GO32 2.6.2 wrong result from SecondsBetween

2013-09-17 Thread Bart
On 9/17/13, Lubomír Čabla wrote: > I am doing something wrong? Probably rounding errors: DT1:=EncodeDate(2013,5,28)+EncodeTime(15,26,1,0); 2 calculations on floating numbers DT1:=EncodeTime(15,26,1,0); 1 calculation on floating numbers Bart ___ fp

[fpc-pascal] FPC GO32 2.6.2 wrong result from SecondsBetween

2013-09-17 Thread Lubomír Čabla
I am doing something wrong? When I encode the date and time then for SecondsBetween I get 59 instead of 60 and for MilliSecondsBetween also. When I encode only time then for SecondsBetween I get correct answer 60. Free Pascal Compiler version 2.6.2 [2013/02/12] for i386 Target: GO32 v2, i386 Res

Re: [fpc-pascal] FPCUnit test + raise E;

2013-09-17 Thread Marcos Douglas
On Tue, Sep 17, 2013 at 12:18 PM, Marcos Douglas wrote: > On Sun, Sep 15, 2013 at 4:25 PM, Sven Barth > wrote: >> On 15.09.2013 13:05, Marcos Douglas wrote: >>> >>> [[cut]] >>> >>> >>> I tried. No makes difference. >>> (could you explain which the difference to call "raise" using "raise E >>> at

Re: [fpc-pascal] fpc 2.6.3 building i386 crosscompiler fails

2013-09-17 Thread patspiper
On 17/09/13 15:12, Lukas Gradl wrote: Hi! Tried to build the current svn of FPC 2.6.3 (svn Revision 25507) on my Linux X86_64-box. I did: make distclean make all FPC= sudo make install PREFIX= FPC= This worked so far, now I have the current svn as x86_64 compiler. Then i did: make clean mak

Re: [fpc-pascal] Generic TFPGList gives me compiler error: Operator is not overloaded

2013-09-17 Thread Sven Barth
On 17.09.2013 14:52, Dennis Poon wrote: I have this: uses fgl; Type RScene=record ID : Word; Name, Category : String; end; TSceneList=specialize TFPGList; The error is: Operator is not overloaded: "RScene" = "RScene" I suppose the generic thing does not know how to compa

[fpc-pascal] Generic TFPGList gives me compiler error: Operator is not overloaded

2013-09-17 Thread Dennis Poon
I have this: uses fgl; Type RScene=record ID : Word; Name, Category : String; end; TSceneList=specialize TFPGList; The error is: Operator is not overloaded: "RScene" = "RScene" I suppose the generic thing does not know how to compare 2 records. How do I solve that? Dennis ___

[fpc-pascal] fpc 2.6.3 building i386 crosscompiler fails

2013-09-17 Thread Lukas Gradl
Hi! Tried to build the current svn of FPC 2.6.3 (svn Revision 25507) on my Linux X86_64-box. I did: make distclean make all FPC= sudo make install PREFIX= FPC= This worked so far, now I have the current svn as x86_64 compiler. Then i did: make clean make all CPU_TARGET=i386 This produces a

Re: [fpc-pascal] Object constructor

2013-09-17 Thread Frederic Da Vitoria
2013/9/17 Xiangrong Fang > My question is, since the programmer is responsible for explicitly call >>> object constructors, then why do we need constructors at all? In another >>> word, what's the difference >>> between an object constructor and an object method? >>> >> >> Using the constructor

Re: [fpc-pascal] Object constructor

2013-09-17 Thread Michael Van Canneyt
On Tue, 17 Sep 2013, Xiangrong Fang wrote: My question is, since the programmer is responsible for explicitly call object constructors, then why do we need constructors at all?  In another word, what's the difference between an object constructor and an ob

Re: [fpc-pascal] Object constructor

2013-09-17 Thread Xiangrong Fang
> > My question is, since the programmer is responsible for explicitly call >> object constructors, then why do we need constructors at all? In another >> word, what's the difference >> between an object constructor and an object method? >> > > Using the constructor tells the compiler that it shou

Re: [fpc-pascal] Object constructor

2013-09-17 Thread Michael Van Canneyt
On Tue, 17 Sep 2013, Xiangrong Fang wrote: Hi All, Could anyone please explain this: 5.4 Constructors and destructors As can be seen in the syntax diagram for an object declaration, Free Pascal supports constructors and destructors. The programmer is responsible for calling the construc