Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   array issues (https://forums.graalonline.com/forums/showthread.php?t=134260988)

MrOmega 11-03-2010 12:30 AM

array issues
 
ok so none of these are working for me

PHP Code:

obj.delete(index)
obj.remove(obj2)
obj.replace(index,obj2)
obj.insert(index,obj2

i've tried a few things but they just simply wont work... why...

fowlplay4 11-03-2010 12:42 AM

Try this:

PHP Code:

function onCreated() {
  
temp.arr = {
    
012345
  
};
  
temp.arr.insert(32.5); // Inserts 2.5 in arr[3]
  
temp.arr.remove(5); // Removes an instance of 5 from array
  
temp.arr.delete(0); // Deletes arr[0] from array
  
temp.arr.replace(1"1.lolz"); // Replaces arr[1] with "1.lolz"
  
echo(temp.arr); // echos "1,1.lolz,2.5,3,4"


I told you this before in the beta thread, you should post your usage of the functions with your reports.

MrOmega 11-03-2010 12:48 AM

there is no specific thing they are not working at all, although what you gave works but one of things i'm doing isnt
PHP Code:

temp.list.insert32.5);
echo( 
temp.list[ 3]); 

still returns the original temp.list[ 3], temp.list is a list of player weapons

ffcmike 11-03-2010 12:54 AM

Quote:

Originally Posted by MrOmega (Post 1609839)
there is no specific thing they are not working at all, although what you gave works but one of things i'm doing isnt
PHP Code:

temp.list.insert32.5);
echo( 
temp.list[ 3]); 

still returns the original temp.list[ 3], temp.list is a list of player weapons

When copying the weapons array the temp.var will actually act as a reference to the same object, which I believe is read-only.

MrOmega 11-03-2010 12:56 AM

Quote:

Originally Posted by ffcmike (Post 1609842)
When copying the weapons array the temp.var will actually act as a reference to the same object, which I believe is read-only.

that's... stupid.


All times are GMT +2. The time now is 08:27 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.