Page 1 of 1

Usecode: calling functions\sub routines

Posted: Wed Jun 30, 2004 12:11 pm
by TMNM Dragon
Not sure how to explain this, so I'll post some code first.

Func02BE 0x2BE ()
{
var getstuff;
var gotstuff;
gotstuff = Func09C2(getstuff);
}

... more Func here...

Func09C2 0x9C2 (var var00)
{
var partysize;
partysize = UI_get_array_size(UI_get_party_list());
return var00;
}

OK, this will say that Func09C2 is not declared.
If I add " extern Func09C2 0x9C2 (var var00); " to the top, i get Function already in use.

Re: Usecode: calling functions\sub routines

Posted: Wed Jun 30, 2004 12:14 pm
by TMNM Dragon
missed a line...

add:
var00 = partysize
before return var00;

Re: Usecode: calling functions\sub routines

Posted: Wed Jun 30, 2004 12:29 pm
by drcode
Looks like a bug. I'll try to verify and fix it tonight.

Re: Usecode: calling functions\sub routines

Posted: Wed Jun 30, 2004 12:42 pm
by wjp
More a missing feature. I don't think you can declare functions without defining them currently. Having to use 'extern' to declare functions that are actually defined in the same file sounds like an abuse of 'extern'.

A temporary workaround would be to move 0x9C2 to above the places where it's used.

Re: Usecode: calling functions\sub routines

Posted: Wed Jun 30, 2004 7:46 pm
by drcode
Yes, it is sort of a feature. But it ought to work now with the next ucc version (just checked it into CVS).