Raised This Month: $32 Target: $400
 8% 

Trouble with function declaration


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Yeah=}
Member
Join Date: Apr 2010
Location: Ural, Russia
Old 04-19-2012 , 10:09   Trouble with function declaration
Reply With Quote #1

While compiling function with same prototype
Code:
stock void:DoSmthg( bool:state, index )
I had this error: "Error 010: invalid function or declaration".
Though when I replaced it to
Code:
stock void:DoSmthg( bool:st, index )
problem disapeared. Is "state" an undocumented keyword of SourcePawn? I didn't found information about it...

Last edited by Yeah=}; 04-19-2012 at 10:10.
Yeah=} is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 04-19-2012 , 10:19   Re: Trouble with function declaration
Reply With Quote #2

Yep, see here on site 114.

Yours sincerely
Impact
__________________

Last edited by Impact123; 04-19-2012 at 10:19.
Impact123 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-19-2012 , 10:36   Re: Trouble with function declaration
Reply With Quote #3

Quote:
Originally Posted by Yeah=} View Post
While compiling function with same prototype
Code:
stock void:DoSmthg( bool:state, index )
I had this error: "Error 010: invalid function or declaration".
Though when I replaced it to
Code:
stock void:DoSmthg( bool:st, index )
problem disapeared. Is "state" an undocumented keyword of SourcePawn? I didn't found information about it...
state is a documented keyword of Pawn, although I believe they are unused in SourcePawn... we use function callbacks instead.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-19-2012 at 10:38.
Powerlord is offline
Yeah=}
Member
Join Date: Apr 2010
Location: Ural, Russia
Old 04-20-2012 , 07:48   Re: Trouble with function declaration
Reply With Quote #4

Quote:
Originally Posted by Impact123 View Post
Yep, see here on site 114.

Yours sincerely
Impact
Thanks, found a list of keywords.

Code:
assert defined #assert const
break sizeof #define forward
case state #else native
continue tagof #elseif new
default #endif operator
do #endinput public
else #error static
exit #file stock
for #if
goto #include
if #line
return #pragma
sleep #section
state #tryinclude
switch #undef
while
Yeah=} is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 04-20-2012 , 09:02   Re: Trouble with function declaration
Reply With Quote #5

Also, you don't need the void: tag.
__________________
Dr. McKay is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-20-2012 , 11:39   Re: Trouble with function declaration
Reply With Quote #6

Quote:
Originally Posted by Dr. McKay View Post
Also, you don't need the void: tag.
And having it is going to break things.
__________________
asherkin is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode