Method calls in Codeblocks

This forum is meant for questions and discussions about the X# language and tools
Post Reply
stefan.ungemach
Posts: 71
Joined: Thu Jul 15, 2021 10:46 am
Location: Germany

Method calls in Codeblocks

Post by stefan.ungemach »

I hope that this is a trivial problem:

I declare a simple codeblock like this

aInfo[2] := {#PERSJAHR, { { {|oSrv| oSrv:FG( #PZZADNR ) }, 1, {|Jahr, AGS, PK| PK }, .f. }}}

which will receive a class instance that has a FG method. However, the compiler throws

Fehler XS1061 'usual' does not contain a definition for 'FG' and no accessible extension method 'FG' accepting a first argument of type 'usual' could be found (are you missing a using directive or an assembly reference?) lib_(F9 generiert)_KOBIncludes C:Usersstefan.ungemachsourcereposXSharpXBasislib_(F8 generiert)_KOBIncludes_PK.PRG 19

From all I know this should work and I have other places in the code where this works. What am I missing (an include, a USING-statement...)?
User avatar
Chris
Posts: 4898
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Method calls in Codeblocks

Post by Chris »

Hi Stefan,

Yes, it is trivial! You just need to enable the option to allow late binding in the project options window, and it should compile fine.

.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
stefan.ungemach
Posts: 71
Joined: Thu Jul 15, 2021 10:46 am
Location: Germany

Method calls in Codeblocks

Post by stefan.ungemach »

Thank you - that was missing in one of my projects. Still need more routine... ;)
Post Reply