Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-07

Procedural variables as methods

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Timothy Groves

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;

Reply by email