Sign in to follow this  
Followers 0
c.haslam

How to detect whether a value has been assigned to an array element

2 posts in this topic

Consider this code:

CODE
Global $ar[100]

$ar[49] = 23

MsgBox(0,"",IsDeclared("ar[49]"))

MsgBox tells me that $ar[49] has not been assigned a value.

How can I detect that it has been assigned a value?

...chris


...chris

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Consider this code:

CODE
Global $ar[100]

$ar[49] = 23

MsgBox(0,"",IsDeclared("ar[49]"))

MsgBox tells me that $ar[49] has not been assigned a value.

How can I detect that it has been assigned a value?

...chris

I don't know if you choose the right function. IsDeclared check if a variable has been declared not if a value is assign.

Eventually you can use Eval function().

Edited by Andreik

When the words fail... music speaks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0