Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   array member return limit function? (https://forums.graalonline.com/forums/showthread.php?t=70837)

Chompy 12-17-2006 05:44 PM

array member return limit function?
 
Well, I have no idea what I wrote in the title, well let me explain:

PHP Code:

temp.arr = { "foo""bar""baz"};
temp.new_arr returnarraylengthtemp.arr12);

echo( 
temp.new_arr); // would return bar,baz 

temp.new_arr would like produce { "bar", "baz"}
but is there a way to do this without loops or?

Well, this looks like a suggestion, I would like it to be added, but is there a way to do this?
(the example is the suggestion)

WanDaMan 12-17-2006 06:05 PM

Are you wanting to know how many charactors there is used within the array?

Chompy 12-17-2006 06:15 PM

Quote:

Originally Posted by WanDaMan (Post 1254491)
Are you wanting to know how many charactors there is used within the array?

Nope, I want to return a length specified in an array..

Example:

If I had an array containing { 1, 2, 3, 4, 5, 6}; I would like to return a length of the array,
I would like to return like { 2, 3, 4, 5}; of the current array, is there an way to do this?

WanDaMan 12-17-2006 06:22 PM

Quote:

Originally Posted by Chompy (Post 1254495)
Nope, I want to return a length specified in an array..

Example:

If I had an array containing { 1, 2, 3, 4, 5, 6}; I would like to return a length of the array,
I would like to return like { 2, 3, 4, 5}; of the current array, is there an way to do this?

Oh, like this? This is what Andrew suggests...

Quote:

temp.myArray = {"Test", "Hi", "Boo", "loltest", "Ahh"};
echo(temp.myArray.length() - (temp.myArray.size() - 1));
:confused:

Chompy 12-17-2006 06:48 PM

Quote:

Originally Posted by WanDaMan (Post 1254496)
Oh, like this? This is what Andrew suggests...



:confused:

That returned 19

Admins 12-17-2006 07:09 PM

temp.arr.subarray(1,2) ?

Chompy 12-17-2006 07:46 PM

Quote:

Originally Posted by Stefan (Post 1254509)
temp.arr.subarray(1,2) ?

Perfect :D Just what I needed :)


All times are GMT +2. The time now is 11:52 PM.

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