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

When do AddToForward return false?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 07-26-2014 , 17:26   When do AddToForward return false?
Reply With Quote #1

The AddToForward function documentation states that it returns true on success and false otherwise.

Which extra checks do I have to do to prevent it from returning false? I want to avoid delegating this check to the caller of my function.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
Cookies.net
Senior Member
Join Date: Jan 2011
Old 07-26-2014 , 18:34   Re: When do AddToForward return false?
Reply With Quote #2

Have a look at these 2 functions here and here.

It'll only return false if you're currently having some parameters pushed to the forward, that's it.
So as long as you remember to Call_Finish or Call_Cancel after all your Call_Push* you're good to go.

Also, aren't problems usually better dealt with after they happen? This seems to be a question that's asked in advance, for something that could theoretically happen, but hasn't seemingly been a problem for anyone ever before.
Cookies.net is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 07-26-2014 , 19:41   Re: When do AddToForward return false?
Reply With Quote #3

Thank you. It's used in an API I'm working on, and I need to be clear on every outcome of its functions. I don't want to make assumptions.

It sounds like it should throw an error instead of returning false. On the other hand I can't see any reason it should fail. I guess it's not reading the list of callbacks until the call is finished, so it could be fine to add forwards late too.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)

Last edited by rhelgeby; 07-26-2014 at 19:42.
rhelgeby is offline
Send a message via MSN to rhelgeby
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 18:47.


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