Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 7 of 7 total |
Compiler Bug? |
Mon, Apr 13 2015 8:17 PM | Permanent Link |
Doug B | I couldn't figure out why my request class was giving me exceptions when I accessed it, until I found this line:
fServerRequest := TServerRequest.Create; When I changed it to: fServerRequest := TServerRequest.Create(nil); Everything worked. Shouldn't the compiler complain that I was missing a parameter? Thanks, Doug |
Tue, Apr 14 2015 2:32 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Doug,
<< Shouldn't the compiler complain that I was missing a parameter? >> TObject.Create Tim Young Elevate Software www.elevatesoft.com |
Wed, Apr 15 2015 4:02 AM | Permanent Link |
Matthew Jones | Tim Young [Elevate Software] wrote:
> << Shouldn't the compiler complain that I was missing a parameter? >> > > TObject.Create Forgive me, but I don't understand that. I checked the help to see if that was a pointer to something, but nothing obvious. -- Matthew Jones |
Wed, Apr 15 2015 12:27 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Matthew,
<< Forgive me, but I don't understand that. I checked the help to see if that was a pointer to something, but nothing obvious. >> He was calling the TObject.Create method, not the TComponent.Create method. One must always remember that there's a public TObject.Create ancestor method that will match a Create call without any parameters. When that happens, the TComponent.Create method isn't called, and all of the ownership, parenting, etc. initialization that occurs normally will *not* occur. Tim Young Elevate Software www.elevatesoft.com |
Wed, Apr 15 2015 12:54 PM | Permanent Link |
Matthew Jones | Tim Young [Elevate Software] wrote:
> << Forgive me, but I don't understand that. I checked the help to see > if that was a pointer to something, but nothing obvious. >> > > He was calling the TObject.Create method, not the TComponent.Create > method. One must always remember that there's a public TObject.Create > ancestor method that will match a Create call without any parameters. > When that happens, the TComponent.Create method isn't called, and all > of the ownership, parenting, etc. initialization that occurs normally > will not occur. Ah, right. A sort of standard inheritance gotcha, that we don't usually fall over, but just might. -- Matthew Jones |
Thu, Apr 16 2015 3:37 PM | Permanent Link |
Doug B | Thanks, Tim.
I guess it's just different in Delphi, where the following would show an error: " E2035 Not enough actual parameters" var c: TComponent; begin c := TComponent.Create; end; Doug "Tim Young [Elevate Software]" wrote: Matthew, << Forgive me, but I don't understand that. I checked the help to see if that was a pointer to something, but nothing obvious. >> He was calling the TObject.Create method, not the TComponent.Create method. One must always remember that there's a public TObject.Create ancestor method that will match a Create call without any parameters. When that happens, the TComponent.Create method isn't called, and all of the ownership, parenting, etc. initialization that occurs normally will *not* occur. Tim Young Elevate Software www.elevatesoft.com |
Mon, Apr 20 2015 4:29 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Doug,
<< I guess it's just different in Delphi, where the following would show an error: >> EWB's compiler has automatic overloads. If it finds a method with the correct signature *anywhere* in a given class hierarchy, then it will consider it resolved and use it. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, September 17, 2024 at 06:44 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |