PDA

Click to See Complete Forum and Search --> : Questions (Not Problems)


Yonatan
Nov 21st, 1999, 12:00 AM
Enum:

A list of constants... How can I explain this... Look at the example:

Enum MyEnum
MyZero ' First value is zero if unspecified
MyOne ' If value is unspecified, it equals (the value from before) + 1
MyTwo
MyThree
MyEight = 8 ' Specified
MyNine
End Enum

Dim Something As MyEnum

Something = MyZero ' Something = 0
Something = MyTwo ' Something = 2
Something = MyNine ' Something = 9

This probably wasn't the best explanation... Check online help...

------------------
Yonatan
Teenage Programmer
E-Mail: RZvika@netvision.net.il
ICQ: 19552879 (http://www.icq.com/19552879)
AIM: RYoni69

[This message has been edited by Yonatan (edited 11-21-1999).]

ShadowCrawler
Nov 21st, 1999, 04:49 AM
To enumerate something is, basically, to assign a number value to a string of text. Here's an example of some code I have in one of my programs:


Public Enum WA_Turn
C = &H1303&
CC = &H1304&
Around = &H1305&
End Enum

Public Sub Turn(Direction As WA_Turn)
Message(Direction)
End Sub


When the programmer types "Turn(", a pop-up box will display, listing ONLY the three values in the WA_Turn enumeration. Easy way of eliminating unessecary items, while making it easier to remember (CC is easier than &H1304&)

------------------
(¯`·.¸¸.·´¯`·->ShadowCrawler<-·´¯`·.¸¸.·´¯)
Teenage Programmer
Visual Basic, HTML, C++, JavaScript
http://welcome.to/X12Tech
Email: craigkovatch@compuserve.com
ICQ#: 9872708 (http://wwp.mirabilis.com/9872708)

Dayo312
Nov 21st, 1999, 11:53 AM
I have A few Q's that I want to know.

What(s) a/is Enum?? Whats it do, I just dont know.

--

Becuase I bought the learning Ed. is there like no way to make like DLL files , Active X Mod. and All the other cool stuff.. Is there some software I could download??

---

Using a data base, how do I Specify this:
Put Box a, 3 in TestDB....??

-----

How do you specify what variables to record in a ini file.

-----

Thankyou!!

Lyla
Nov 22nd, 1999, 12:53 AM
Hi ShadowCrawler..

Would you please go further in explaning what is the common use of Enum. I'm just like (Dayo312), I read about it a lot but with no clue about it's possible use.
If you may, would you post some simple example?

Thanx for sharing & helping.