Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 5 of 5 total |
Not A Function |
Sun, Apr 17 2016 4:01 PM | Permanent Link |
squiffy Telemix Ltd. | I have the below defined in a Unit :
type TModelClients = class(TObject) public property ID : Integer read ReturnID; ... protected function ReturnID : Integer; ... implementation function TModelClients.ReturnID : Integer; begin Log('arrggh'); Result:=1; end; I call it like this : procedure TfrmAllocNum2.butSetMarginClick(Sender: TObject); var m : TModelClients; i : Integer; begin m:=TModelClients.Create; i := m.ID; end; But I get a window with this message in it from the i:=m.ID line Error : m.returnid is not a function. Can anyone save me from madness? |
Sun, Apr 17 2016 4:31 PM | Permanent Link |
squiffy Telemix Ltd. | Ok, I know why this is - Sender is a TDataset and not my class. Obvious really, but wood/trees/etc.
This morphs my question into - is there any way I can reference the class instance I created in the AfterLoad event for a TDataSet contained within that class? I want to be able to call a class function for the instance AFTER the AfterLoad event has fired. I know I could create a global variable, but that's clunky especially if I want to create many of these on a single form all possibly "live" at the same time. I am declaring the class in a button click, but the AfterLoad event just has Sender passed. I seem unable to access the Parent which I assume would be the class instance. I'm getting myself a little confused, I think... |
Sun, Apr 17 2016 7:43 PM | Permanent Link |
Raul Team Elevate | On 4/17/2016 4:31 PM, squiffy wrote:
> Ok, I know why this is - Sender is a TDataset and not my class. Obvious really, but wood/trees/etc. > This morphs my question into - is there any way I can reference the class instance I created in the AfterLoad event for a TDataSet contained within that class? I want to be able to call a class function for the instance AFTER the AfterLoad event has fired. I know I could create a global variable, but that's clunky especially if I want to create many of these on a single form all possibly "live" at the same time. TDataset is based on TComponent that has a generic data property (http://www.elevatesoft.com/manual?action=viewprop&id=ewb2&comp=TComponent&prop=Data) Would that work for you ? (i.e create an instance of your class and assign to TDataSet.Data) Raul |
Mon, Apr 18 2016 3:37 AM | Permanent Link |
squiffy Telemix Ltd. | Raul - works perfectly, thanks!
I think I may need to rethink how I'm doing what I'm doing, but this can sit in until I do. |
Mon, Apr 18 2016 5:51 AM | Permanent Link |
squiffy Telemix Ltd. | ,,,and extra well done for getting a meaningful answer from that dogs dinner of a question. I just re-read it, and it doesn't make a lot of sense (I've missed out a major portion of how it works).
I shouldn't ask questions when I'm confused, and therein lies the problem |
This web page was last updated on Thursday, October 10, 2024 at 02:11 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |