Re: [fpc-pascal] {SOLVED} casting back a pointer to original type

2010-05-30 Thread David Emerson
> OK, I lurred myself by taking words too literally. I thought "virtual" meant > unimplemented, to be implemented in sub-classes. unimplemented = abstract virtual method type something = class procedure do_something; virtual; abstract; end; _

Re: [fpc-pascal] fpweb fcgi: auto shutdown feature

2010-05-30 Thread Horacio Jamilis
I am new to this technology... I was using isapi, with and isapoloader dll, that was responsible of the upgrade of the application. The isapiloader before sending the request to the actual isapi application, it tried to find if there is a new version of it, with the same name of the dll but wit

Re: [fpc-pascal] power?

2010-05-30 Thread spir ☣
On Sun, 30 May 2010 18:28:47 +0200 Reimar Grabowski wrote: > On Sun, 30 May 2010 15:03:03 +0200 > spir ☣ wrote: > > > PS: is there a round(fractional_size) function? that's the reason why i > > needed power. > > http://community.freepascal.org:1/docs-html/rtl/system/round > > R. Sorry,

Re: [fpc-pascal] power?

2010-05-30 Thread Reimar Grabowski
On Sun, 30 May 2010 15:03:03 +0200 spir ☣ wrote: > PS: is there a round(fractional_size) function? that's the reason why i > needed power. http://community.freepascal.org:1/docs-html/rtl/system/round R. -- A: Because it messes up the order in which people normally read text. Q: Why is top

Re: [fpc-pascal] casting back a pointer to original type --> variable & value types

2010-05-30 Thread Andrew Hall
On 30 May 10, at 04:00 , spir ☣ wrote: > So, it seems the language knows (at runtime) about the real type of a > *value*. I must declare element, the variable, with type C, since I do not > know anything at coding time. But Pascal correctly calls C1.text, due to > "virtual" & "override" modifie

Re: [fpc-pascal] timing again

2010-05-30 Thread spir ☣
On Tue, 18 May 2010 10:47:33 +0200 (CEST) "Tomas Hajny" wrote: > On Mon, May 17, 2010 22:25, spir ☣ wrote: > > > Hello Denis, > > > I posted a question about timing some time a go and got an answer; but let > > down for a while because other problems required my attention. So, I need > > a s

Re: [fpc-pascal] power?

2010-05-30 Thread Henry Vermaak
2010/5/30 spir ☣ : > Hello, > >    // a & b are ints >    n := a ** b;        // error: operator is not overloaded >    n := power(a,b);    // error: identifier not found "power" uses math; http://freepascal.org/docs-html/rtl/math/power.html ___ fpc-pas

[fpc-pascal] power?

2010-05-30 Thread spir ☣
PS: is there a round(fractional_size) function? that's the reason why i needed power. Denis vit esse estrany ☣ spir.wikidot.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/ma

[fpc-pascal] power?

2010-05-30 Thread spir ☣
Hello, // a & b are ints n := a ** b;// error: operator is not overloaded n := power(a,b);// error: identifier not found "power" Conversion to real does not help. How can I do? Denis vit esse estrany ☣ spir.wikidot.com __

Re: [fpc-pascal] Between bug?

2010-05-30 Thread Marco van de Voort
In our previous episode, Bee Jay said: > > Then it shouldn't use floating point. Ever. > > Well... then it shouldn't be using FPC? ;) This kind of problems are universal, and TDateTime is a library invention. If you have an integer date based library, you can use that instead. > Ok, forget about

Re: [fpc-pascal] Between bug?

2010-05-30 Thread Jonas Maebe
On 30 May 2010, at 14:38, Bee Jay wrote: > 2010, at 19:28, Jonas Maebe wrote: > >> Then it shouldn't use floating point. Ever. > > Well... then it shouldn't be using FPC? ;) They should not be using any FPC functionality relying on floating point. Any person who uses floating point should kn

Re: [fpc-pascal] Between bug?

2010-05-30 Thread Bee Jay
On 30 Mei 2010, at 19:28, Jonas Maebe wrote: > Then it shouldn't use floating point. Ever. Well... then it shouldn't be using FPC? ;) Ok, forget about the rocket launcher. The important note that I think need to be addressed is the bug only occurs if the milisecond part of a or b is 0. Other t

Re: [fpc-pascal] Between bug?

2010-05-30 Thread Jonas Maebe
On 30 May 2010, at 14:23, Bee Jay wrote: > What if an app need a precise and correct result, say a rocket launcher? Then it shouldn't use floating point. Ever. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.

Re: [fpc-pascal] Between bug?

2010-05-30 Thread Bee Jay
On 30 Mei 2010, at 19:18, Marco van de Voort wrote: > IIRC this is normal and delphi compatible and due to TDatetime being a > floating point type. No, it's not Delphi compatible. Delphi's result is alot worst, at least on Delphi 7. And I didn't ask to make it truly compatible with Delphi. ;) >

Re: [fpc-pascal] Between bug?

2010-05-30 Thread Marco van de Voort
In our previous episode, Bee Jay said: > Hi all, > > Try the following code snippet: > > uses > DateUtils; > var > a,b: TDateTime; > i: integer; > begin > a := EncodeDateTime(2010, 1, 1, 0, 0, 0, 0); > for i := 0 to 9 do > begin > b := EncodeDateTime(2010, 1, 1, 0, 0, i, 0); >

Re: [fpc-pascal] fpweb fcgi: auto shutdown feature

2010-05-30 Thread Bee Jay
On 30 Mei 2010, at 19:06, Michael Van Canneyt wrote: > But if you want it, it's really easy to do in fcl-web. Create a webmodule, > implement the OnRequest handler of the module, and add > Application.Terminate:=True; > Handled:=True; > in the handler. Then register the module with the name 'sh

Re: [fpc-pascal] fpweb fcgi: auto shutdown feature

2010-05-30 Thread Michael Van Canneyt
On Sun, 30 May 2010, Bee Jay wrote: On 28 Mei 2010, at 23:18, Michael Van Canneyt wrote: I'll have a look at it next week. But it will be under control of an option, and this option will be 'off' by default. Another thought about this feature. I think it'd be nice if there's an option to

[fpc-pascal] Between bug?

2010-05-30 Thread Bee Jay
Hi all, Try the following code snippet: uses DateUtils; var a,b: TDateTime; i: integer; begin a := EncodeDateTime(2010, 1, 1, 0, 0, 0, 0); for i := 0 to 9 do begin b := EncodeDateTime(2010, 1, 1, 0, 0, i, 0); Writeln(SecondsBetween(a,b):3); end; end; I think the result isn'

Re: [fpc-pascal] casting back a pointer to original type --> variable & value types

2010-05-30 Thread spir ☣
This is a follow-up to the previous thread. Say I put in a TFPList elements of types C C1 C2, where C is a super-class. When I retrieve an element using var element : C; ... element := C(list[index]); text := element.text; ... what is the actual type of element? and of its value?

Re: [fpc-pascal] {SOLVED} casting back a pointer to original type

2010-05-30 Thread spir ☣
On Sat, 29 May 2010 16:54:44 -0700 Andrew Hall wrote: > On 29 May 10, at 15:26 , spir ☣ wrote: > > I cannot do that. C0 (and all classes) instances need a text method. I also > > cannot have 2 methods (one static, one virtual) with different names. It's > > a basic feature, always called with t

Re: [fpc-pascal] RE: Comedi Lib Header translation, was: h2pas enum error

2010-05-30 Thread Schindler Karl-Michael
Am 20.05.2010 um 11:21 schrieb Hartmut Eilers: >> If it is you can resolve it using the C preprocessor using a command >> line similar to this one: > >> cpp --no-stdinc comedi.h > comedi.cpped.h > >> Afterwards try h2pas again. > > I tried the above mentioned fix with the following result: > >

Re: [fpc-pascal] fpweb fcgi: auto shutdown feature

2010-05-30 Thread Bee Jay
On 28 Mei 2010, at 23:18, Michael Van Canneyt wrote: > I'll have a look at it next week. But it will be under control of an option, > and this option will be 'off' by default. Another thought about this feature. I think it'd be nice if there's an option to shutdown the app gracefully. What I me