Jump to content
Sign in to follow this  
McArcher

How to check if array is empty?

Recommended Posts

How to check if array is empty?

tried

if ( (count _array) > 0 )

, but it doesn't work.

maybe i should check _array select 0 ?

---------- Post added at 19:25 ---------- Previous post was at 19:24 ----------

arma's functions are very strangely working.... i don't know who wrote such code...

---------- Post added at 19:27 ---------- Previous post was at 19:25 ----------

if ( not isNull (mcti_barracks_ru select 0) ) then {

doesn't work either

---------- Post added at 19:29 ---------- Previous post was at 19:27 ----------

if ( not isNil (mcti_barracks_ru select 0) ) then {
also :)

---------- Post added at 19:30 ---------- Previous post was at 19:29 ----------

if ( not isNil (mcti_barracks_ru) ) then {
and
if ( not isNull (mcti_barracks_ru) ) then {
also don't help...

---------- Post added at 19:31 ---------- Previous post was at 19:30 ----------

omg.... quotes... i forgot "s maybe?)

---------- Post added at 19:32 ---------- Previous post was at 19:31 ----------

if ( not isNil ("mcti_barracks_ru") ) then {
doesn't work either)

---------- Post added at 19:37 ---------- Previous post was at 19:32 ----------

if ( not (isNull "mcti_barracks_ru") ) then {
too :(

Share this post


Link to post
Share on other sites

if (count _array == 0) then { hint "array is empty" };

if (isnil "_array") then { hint "array doesnt exist" };

Share this post


Link to post
Share on other sites

thanks!

now

if (isnil "mcti_barracks_ru") then

{

RU_player_1 globalChat "array doesnt exist";

} else

{

RU_player_1 globalChat "array exists";

if (count mcti_barracks_ru == 0) then

{

RU_player_1 globalChat "array is empty";

} else {

RU_player_1 globalChat "array is not empty";

};

};

says that it exists and is empty :yay: hooray! :bounce3:

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×