Jump to content

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


c.haslam
 Share

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...