Raised This Month: $75 Target: $400
 18% 

Natives can return arrays in PAWN!


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-09-2019 , 09:13   Re: Natives can return arrays in PAWN!
Reply With Quote #11

Quote:
Originally Posted by thEsp View Post
For example *_to_str natives SHOULD return array/string instead. Sure it might be "limited" (if that's the right term) but still there would be no need to declare a string and use them (which is a bit annoying).

Seems to be more efficient, right?
You still need to "declare a string to use them", otherwise where would the result go?
Also, why do you talk about efficiency here? It's unrelated.
__________________
HamletEagle is offline
thEsp
Veteran Member
Join Date: Aug 2017
Location: Gjilan, Albania
Old 08-09-2019 , 09:41   Re: Natives can return arrays in PAWN!
Reply With Quote #12

Quote:
Originally Posted by HamletEagle View Post
You still need to "declare a string to use them", otherwise where would the result go?
That might be true but it depends on what user needs. If natives I referred to work that way, you can still store or occasionally use them directly.

Quote:
Originally Posted by Mistrick View Post
I think he told about some use cases like we need to create temp variable instead paste function as argument another function.
Totally correct.
__________________

Last edited by thEsp; 08-09-2019 at 09:44.
thEsp is online now
Mistrick
Senior Member
Join Date: Aug 2012
Location: Russia
Old 08-09-2019 , 09:42   Re: Natives can return arrays in PAWN!
Reply With Quote #13

Quote:
Originally Posted by HamletEagle View Post
You still need to "declare a string to use them", otherwise where would the result go?
I think he told about some use cases like we need to create temp variable instead paste function as argument another function.

PHP Code:
new num[6];
num_to_str(1numcharsmax(num));
menu_additem(menu"First"num);

menu_additem(menu"Second"num_to_str2(2)); 
Mistrick is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-09-2019 , 10:09   Re: Natives can return arrays in PAWN!
Reply With Quote #14

Fair enough, I only took into account the example that Klippy provided.
__________________
HamletEagle 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 11:44.


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