[Lazarus] Procedural variables as methods
OK, so I solved the problem of assigning a function to a procedural variable (the problem was that I was stupid). But now I can't call it. When I attempt to do so, it gives me: ghistory.pas(260,19) Error: Incompatible types: got tLanguage.procedure variable type of function:AnsiString;Register expected AnsiString Is there something I have to add to the call to make it work? Some code follows. (in tLanguage method) MaleName := @SaxonMale; FemaleName := @SaxonFemale; ClanName := @SaxonFamily; PlaceName := @SaxonPlace; (in main code) Language := tLanguage.Create; a := Language.ClanName; -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Procedural variables as methods
Yes, you need to add braces. a := Language.ClanName(); Vojtěch __ Od: Timothy Groves the.tail.kin...@gmail.com Komu: Lazarus mailing list lazarus@lists.lazarus.freepascal.org Datum: 28.07.2013 23:28 Předmět: [Lazarus] Procedural variables as methods Is there something I have to add to the call to make it work? Some code follows. (in tLanguage method) MaleName := @SaxonMale; FemaleName := @SaxonFemale; ClanName := @SaxonFamily; PlaceName := @SaxonPlace; (in main code) Language := tLanguage.Create; a := Language.ClanName; -- -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus