Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-17-2006, 05:44 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
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)
__________________
Reply With Quote
  #2  
Old 12-17-2006, 06:05 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Are you wanting to know how many charactors there is used within the array?
__________________
V$:CONFL16T
Reply With Quote
  #3  
Old 12-17-2006, 06:15 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by WanDaMan View Post
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?
__________________
Reply With Quote
  #4  
Old 12-17-2006, 06:22 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Quote:
Originally Posted by Chompy View Post
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));
__________________
V$:CONFL16T
Reply With Quote
  #5  
Old 12-17-2006, 06:48 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by WanDaMan View Post
Oh, like this? This is what Andrew suggests...



That returned 19
__________________
Reply With Quote
  #6  
Old 12-17-2006, 07:09 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
temp.arr.subarray(1,2) ?
Reply With Quote
  #7  
Old 12-17-2006, 07:46 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Stefan View Post
temp.arr.subarray(1,2) ?
Perfect Just what I needed
__________________
Reply With Quote
Reply


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 06:33 PM.


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