Enumerated Types?

  • Thread starter Thread starter nobody
  • Start date Start date
N

nobody

Below are Delphi enumerated type declarations.
What are the equivalents in VB .Net?

Type language = (EnglishUS, EnglishUK, Spanish, German, Italian, French);

Var language : (EnglishUS, EnglishUK, Spanish, German, Italian, French);
 
Hi Nobody,

I'm not exactloy sure what those two statements do.

I reckon the first is the enumeration:

Public Enum language
EnglishUS
EnglishUK
Spanish
German
Italian
French
End Enum

But I don't understand why the Var repeats the whole list.

Dim Var As language

In use:
Var = language.Italian

Regards,
Fergus
 
Fergus said:
Hi Nobody,

I'm not exactloy sure what those two statements do.

I reckon the first is the enumeration:

Public Enum language
EnglishUS
EnglishUK
Spanish
German
Italian
French
End Enum

But I don't understand why the Var repeats the whole list.

It doesn't, those were 2 ways of doing the same thing.
 
Fergus said:
Hi Nobody,

I'm not exactloy sure what those two statements do.

I reckon the first is the enumeration:

Public Enum language
EnglishUS
EnglishUK
Spanish
German
Italian
French
End Enum

But I don't understand why the Var repeats the whole list.

Dim Var As language

Where do I Define the Enum and Dim the Variable so that
it's global and usable from all procedures in all forms?
 
Hi Piddley,

All Modules are global.

Module Language_Stuff
Public Enum ....
End Enum

Public Var ..
End Module

Regards,
Fergus
 
* nobody said:
Below are Delphi enumerated type declarations.
What are the equivalents in VB .Net?

Type language = (EnglishUS, EnglishUK, Spanish, German, Italian, French);

\\\
<Flags()> _
Public Enum Language
EnglishUs = 1
EnglishUK = 2
Spanish = 4
German = 8
Italian = 16
French = 32
End Enum
///
Var language : (EnglishUS, EnglishUK, Spanish, German, Italian, French);

Maybe:

\\\
Dim n As Language = Language.EnglishUs Or Language.EnglishUK Or ...
///
 
Back
Top