Graal Forums  

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

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old 10-27-2005, 01:41 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
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
Closed Thread


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 01:25 AM.


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