ID:163958
Jul 25 2007, 7:55 am
|
|
If I have a list with 1 or more objects in it how do I determine how many objects are in it?
|
In response to Kangchao
|
|
if(list.len) //<-- I know this asks if the list has any length But how do I ask if the list has a length of 2 or 3? |
In response to Tranovan
|
|
..bump..
|
In response to Tranovan
|
|
if(list.len=2||3)
Maybe this, I'm not too sure. |
In response to Tranovan
|
|
Just as he said: The list's length is stored in the 'len' variable. As such, it will be equal to how many items are in the list:
var/list/myList1=list("one","two","three") |
In response to DarkD3vil666
|
|
DarkD3vil666 wrote:
> if(list.len=2||3) Maybe this, I'm not too sure. Almost. You need to be using the == operator here. Also, you must give another statement to be evaluated after the || operator. if(myList.len==2 || myList.len==3) |
-TKL