Can extender funtions be defined in a module?

Started by RickJ, Sun 15/11/2009 00:10:26

Previous topic - Next topic

RickJ

In the latest V3.2RC it would appear that it's not permitted to define extender functions in a module.  Doing so produces an error as shown in the example below.
Code: ags

*** Module Header ***
import function FunctionName(this *Character);

*** Module Script ***
function FunctionName(this *Character) {
}

*** Compiler Message ***
Failed to save room room0.crm; details below
BluTemplate.ash(125): Error (line 125): 'this' must be followed by a struct name


I thought we used to be able to do this but I may be mis-remembering.  Could someone verify if this is the correct operation or if it's a bug.

Lufia

Try is with this Character* ? That's how the example for extender functions is written in the manual.

TerranRich

That's how I have it:

Quote
function FadeObject(this Object*, FadeDirection fdDir, String sSeconds)
{
    ...
}
Status: Trying to come up with some ideas...

RickJ

Thanks guys.  I had looked at the example in the help but didn't see the difference... I feel so stupid.   :=

SMF spam blocked by CleanTalk