Raised This Month: $51 Target: $400
 12% 

Special function parameters


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 11-28-2011 , 23:30   Special function parameters
Reply With Quote #1

Hey there.
I was battling with timers and invalid handle errors the last days until i found my problem.
I had this stock
View code

After debugging my problem was solved with this code.
View code

I did not completely read the documentation yet, but i could not find it in the sites it supposed to be.
Now my question is: What this character is doing in that case and why do i need it?

Yours sincerely
Impact
__________________

Last edited by Impact123; 11-28-2011 at 23:44.
Impact123 is offline
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 11-29-2011 , 01:40   Re: Special function parameters
Reply With Quote #2

I'm not 100% sure about Pawn here but I guess it is the reference operator:
http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf
Page 12-14

This means you don't pass a copy of the Object to the function but you pass a reference to the original Object to the function so you can operate on the original Object rather than on a copy.
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de
Sillium is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 11-29-2011 , 01:53   Re: Special function parameters
Reply With Quote #3

Yep, that makes sense.
Thank you very much.

Yours sincerely
Impact
__________________
Impact123 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 11-29-2011 , 09:39   Re: Special function parameters
Reply With Quote #4

Yes, it's the pass by reference operator.

CloseHandle in your statement worked fine, the problem was with
PHP Code:
rHandle INVALID_HANDLE
If you don't have the & operator, this doesn't actually do anything, as the calling function still has the old value for the Handle.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Reply



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 06:39.


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