Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   Duplicate: echoing passed multidimensional arrays (https://forums.graalonline.com/forums/showthread.php?t=61934)

Dach 10-27-2005 03:57 AM

Duplicate: echoing passed multidimensional arrays
 
Nothing big here, atleast I'm not sure how this would affect any script other than giving garbled debug output. Anyway, when this weapon script is run:
PHP Code:

//#CLIENTSIDE
function onWeaponfired() {
  array = {{
10,11},{20,21}};
  
test_func(array);
  array[
0][1] = 42;
  
test_func(array);
}
function 
test_func(foo) {
  echo(
foo@""@foo[0][1]);


this is output in the f2 window:
"10,11","20,21"11
"10,11","20,21"42

Just kinda weird that echoing the array gives different results than echoing an element in the array. Only works on multidimensional arrays, and when the array is passed to a function. That may not be all the details, but I didn't try to find out anymore.

Edit: stupid swear filter. seriously, what the hell?

Admins 10-27-2005 01:41 PM

The bug has been reported earlier, modifying a subarray is not notifying the main array of the change, so it's still displaying the same value when output as string


All times are GMT +2. The time now is 09:51 AM.

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