Android Question Enum

Hi All

I have this in VB.net:

[
Public Enum UTMDatum
WGS84
NAD83
GRS80
WGS72
Australian1965
Krasovsky1940
NorthAmerican1927
International1924
Hayford1909
Clarke1880
Clarke1866
Airy1830
Bessel1841
Everest1830
End Enum
]

Which I wrote in B4A as:

[

Public Enum UTMDatum(WGS84,NAD83,GRS80, WGS72,Australian1965,Krasovsky1940,NorthAmerican1927,International1924,Hayford1909,Clarke1880,Clarke1866,Airy1830,Bessel1841,Everest1830)

]

But it is not working. Any hints please?
 

LucaMs

Expert
Licensed User
Longtime User
Use a code module and declare all that "fields" as public constants.

UTMDatum - Code module:
Public Const WGS84 As Int = 1
Public Const NAD83 As Int = 2
Public Const GRS80 As Int = 3
Public Const WGS72 As Int = 4
Public Const Australian1965 As Int = 5
Public Const Krasovsky1940 As Int = 6
Public Const NorthAmerican1927 As Int = 7
Public Const International1924 As Int = 8
Public Const Hayford1909 As Int = 9
Public Const Clarke1880 As Int = 10
Public Const Clarke1866 As Int = 11
Public Const Airy1830 As Int = 12
Public Const Bessel1841 As Int = 13
Public Const Everest1830 As Int = 14

B4X:
If MyVariable = UTMDatum.Krasovsky1940 Then
...

B4X:
Select MyVariable

    Case UTMDatum.GRS80
        '...
    Case UTMDatum.Everest1830
        '...
End Select
 
Last edited:
Upvote 1
Top