Page 1 of 1
function identify criteria
Posted: Mon Feb 27, 2006 10:47 pm
by DevGIB
i always get Expected an identifier, got User Function send_attack instead.
regardless of what i do i cant seem to get rid of it...
whats the criteria to naming a function...
here i was thinking that can_cast would be orright :S
Posted: Tue Feb 28, 2006 12:30 pm
by CWO
I would just rename all instances of send_attack to something completely different. If I recall correctly, I'm thinking this is because you might have a variable and a function with the same name... not sure...
Posted: Tue Feb 28, 2006 2:09 pm
by Beaud
Indeed, duplicated Function; watch for includes.
Posted: Wed Mar 01, 2006 10:48 am
by DevGIB
had a feeling it might be that... thanks guys

Posted: Thu Mar 02, 2006 2:15 am
by daneel
It reports a conflict both when finding a function whose name is the same of another function, or even a
parameter of a function whose name equals another function's (in the scope). I know that from experience
So for example if you try to compile this:
Code: Select all
// scripts/textcmd/gm/myscript.src
use uo;
program my_script(target)
sendsysmessage(target, "you wrote .myscript and you have at least gm rights.");
endprogram
you'll get such error, precisely this:
Code: Select all
Compiling: <POLPATH>\scripts\textcmd\gm\myscript.src
Expected arguments or right-paren in program arglist, got 'Func(2,0): target'
Error detected in program body.
Error occurred at <POLPATH>\textcmd\gm\myscript.src, Line 4
of course because a function named "target" exists in the scope (UO.em).
PS: obviously it won't tell you the same if if finds two arguments of two different functions in the scope having the same name.. the conflict matching occurs in these two cases:
1. function name <--> function name
2. function's parameter name <--> function name
Thanks gang.
Posted: Thu Apr 20, 2006 8:57 pm
by Exar Kun
The Search function DOES work.