Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   standard object functions, problem with multidimensional array/list (https://forums.graalonline.com/forums/showthread.php?t=64253)

jake13jake 02-21-2006 02:07 AM

standard object functions, problem with multidimensional array/list
 
I'm trying to make a rank database, and so I made a two dimensional string array.
this.arr[0] in this script would be acting as an account list
this.arr[1] would be acting as a sort value.

When I was going to sort, I wanted to remove the element and then simply reinsert it. However, something wasn't working so I made this test.

My problem is not being able to use these operators on an array dimension. It's not hard to script something to replace it at all, but it just seems like it should work to use these functions on a specific dimension of an array.

PHP Code:

  this.arr = {0,1,2,3},{4,5,6,7};
  
player.chat this.arr;
  
this.arr[0].delete(1);
  
this.arr[0].insert(1,8);
  
player.chat player.chat SPC this.arr


Admins 02-21-2006 09:54 PM

Should be this.arr = {{0,1,2,3},{4,5,6,7}}; I guess ?

jake13jake 02-22-2006 12:28 AM

Quote:

Originally Posted by Stefan
Should be this.arr = {{0,1,2,3},{4,5,6,7}}; I guess ?

lol, you're right on that one. The other script that I changed because of this was more like:
arr=new[2]
arr[0].add(stuff)
arr[1].add(stuff)

Admins 02-22-2006 04:43 AM

A well known problem yes, it is not telling the 'parent' (next lower dimension) that it has been updated. That's why it's not displaying the right stuff when being output as string, will check if this can been fixed soon.

jake13jake 02-22-2006 05:11 PM

Quote:

Originally Posted by Stefan
A well known problem yes, it is not telling the 'parent' (next lower dimension) that it has been updated. That's why it's not displaying the right stuff when being output as string, will check if this can been fixed soon.

Okay, I was going to use parallel string lists in the first place, but GrowlZ was avid on using a 2xSize array for the ranks. I wonder how people are going to respond to a ranking system on Classic. Show the current top 10 ranks on the server perhaps (reset once a month).


All times are GMT +2. The time now is 06:02 AM.

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