View Single Post
  #1  
Old 10-27-2005, 03:57 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
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?
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial

Last edited by Dach; 10-27-2005 at 04:00 AM.. Reason: that god forsaken swear filter