Hi folks, I guess this is just a basic programming question, but I've been reading the MSDN doc's on JScript's enumeration object and am having troubles 'getting it'.
In my specific scenario, I've opened a connection to a database using the ADODB object. That object has a property called State, which has several values to indicate what's going on with the connection - adStateOpened, adStateClosed, etc, all of type "ObjectStateEnum".
I know the numeric values for these constants, but don't want to have to refer to them as numbers as that's less meaningful than using the given enumerated names. What do I need to do to have access to them in my script??? So, for example, I could write:
code:
if (objDBHandle.State == adStateOpened) { ... }
Instead of...
code:
if (objDBHandle.State == 1) { /* Opened state */ ... }
or...
code:
var _adStateClosed = 0;
var _adStateOpened = 1;
/* ... more states ... */
if (objDBHandle.State == 1) { /* Opened state */ ... }
Ideas?