What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Enumeration?

Enumeration?
Author: Message:
Zero
Junior Member
**

Avatar

Posts: 29
– / Male / Flag
Joined: Aug 2008
O.P. Enumeration?
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?





This post was edited on 09-16-2008 at 07:34 PM by Zero.
09-16-2008 07:29 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Enumeration? - by Zero on 09-16-2008 at 07:29 PM
RE: Enumeration? - by vaccination on 09-16-2008 at 07:51 PM
RE: Enumeration? - by TheSteve on 09-18-2008 at 12:44 AM
RE: Enumeration? - by ShawnZ on 09-18-2008 at 01:09 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On