View Full Version : finding an empty slot in an array
Myron78 02-01-2006, 03:15 PM I am cycling through an array checking its contents and once I get to the end I need to insert another piece of data.
in Java and C++ I'd be looking for a null object. does anyone know what it is n MEL?
Thanks,
-Myron
|
|
DezFX
02-01-2006, 03:34 PM
You can use the size() function to find out where the end of the array is. The result will be the next available index number.
Morganism
02-01-2006, 04:40 PM
Yeah, a good way to add something to the end of an array is:
$myArray[size($myArray)] = "tada!";
CGTalk Moderation
02-01-2006, 04:40 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.