Raised This Month: $ Target: $400
 0% 

[Solved]Array natives


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 10-31-2014 , 07:38   Re: [Solved]Array natives
Reply With Quote #1

By the way: ArrayDeleteItem removes an item from the array entirely. It doesn't just remove the content of the item. It works like this:

Code:
new Array:a = ArrayCreate(); ArrayPushCell(a, 1); // Content: {1} ArrayPushCell(a, 0); // Content: {1,0} new Array:b = ArrayClone(a); // Content: {1,0} ArrayDeleteItem(b, 0); // Content: {0} ArrayGetCell(b, 0); // It looks like item 0 now contains 0, because the old item 1 shifts down new Array:c = ArrayClone(a); // Content: {1,0} ArrayDeleteItem(c, 1); // Content: {1} ArraySetCell(c, 1, 1); // Error: 1 is not a valid item
__________________
In Flames we trust!

Last edited by Nextra; 10-31-2014 at 07:38.
Nextra 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 17:45.


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