Jump to content
Sign in to follow this  
c.haslam

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

Recommended Posts

c.haslam

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


Spoiler

CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard

 

Share this post


Link to post
Share on other sites
Andreik

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  

×