Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-21-2006, 02:07 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
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
Reply With Quote
  #2  
Old 02-21-2006, 09:54 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Should be this.arr = {{0,1,2,3},{4,5,6,7}}; I guess ?
Reply With Quote
  #3  
Old 02-22-2006, 12:28 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
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)
Reply With Quote
  #4  
Old 02-22-2006, 04:43 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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.
Reply With Quote
  #5  
Old 02-22-2006, 05:11 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
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).
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 +2. The time now is 02:14 PM.


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