Raised This Month: $299 Target: $400
 74% 

Any tag in transitional syntax.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shortguy
Member
Join Date: Jul 2009
Old 08-01-2015 , 20:02   Any tag in transitional syntax.
Reply With Quote #1

I'm trying to implement the socket extension in transitional syntax and I can't seem to get the function prototypes to match.

Prototype from their include:
Code:
public(Handle:socket, const errorType, const errorNum, any:arg)
My Prototype:
Code:
public void OnSocketError(Handle socket, const int errorType, const int errorNum, ?) {
I cant find what type the any argument would be? I've tried int but that doesn't seem to work.
shortguy is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 08-01-2015 , 20:27   Re: Any tag in transitional syntax.
Reply With Quote #2

Fairly certain that the type would be "any".
__________________
ddhoward is offline
shortguy
Member
Join Date: Jul 2009
Old 08-01-2015 , 20:34   Re: Any tag in transitional syntax.
Reply With Quote #3

Even with the prototype of:

Code:
public void OnSocketError(Handle socket, const int errorType, const int errorNum, any arg)
It still tells me prototypes do not match.
shortguy is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 08-01-2015 , 20:58   Re: Any tag in transitional syntax.
Reply With Quote #4

PHP Code:
public void OnSocketError(Handle socketint errorTypeint errorNumany arg
This?
headline is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 08-01-2015 , 21:01   Re: Any tag in transitional syntax.
Reply With Quote #5

try int return
Miu is offline
shortguy
Member
Join Date: Jul 2009
Old 08-01-2015 , 21:02   Re: Any tag in transitional syntax.
Reply With Quote #6

Quote:
Originally Posted by Headline22 View Post
PHP Code:
public void OnSocketError(Handle socketint errorTypeint errorNumany arg
This?
Also does not match.
shortguy is offline
splewis
Veteran Member
Join Date: Feb 2014
Location: United States
Old 08-01-2015 , 22:40   Re: Any tag in transitional syntax.
Reply With Quote #7

What about

PHP Code:
public int OnSocketError(Handle socketint errorTypeint errorNumint arg
__________________
splewis is offline
shortguy
Member
Join Date: Jul 2009
Old 08-02-2015 , 00:14   Re: Any tag in transitional syntax.
Reply With Quote #8

splewis and Miu were both correct, had to change return type to int. Thanks!
shortguy is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 08-02-2015 , 17:30   Re: Any tag in transitional syntax.
Reply With Quote #9

Quote:
Originally Posted by shortguy View Post
splewis and Miu were both correct, had to change return type to int. Thanks!
Basically in the new syntax, anything not tagged are matched to int, ex:
Anyone who dealt with TF2OnConditionAdded knows it has no return and is not tagged with anything.
But in the new syntax, it expects the int instead of void for return type.
__________________
WildCard65 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 21:43.


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