VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Simple way to start learning the enum statement

by Chrysovalantis Anastasiades (5 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 15th September 2008
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Simple way to start learning the enum statement

API Declarations


'Declaration(inside a module)
Public seasonpoint As Season
Public Enum Season
Winter = 1
Spring = 2
Summer = 3
Autumn = 4
End Enum
Public Function findSeason(in1 As Season) As String
Dim b As String
Select Case in1
Case 1
b = "Winter"
Case 2
b = "Spring"
Case 3
b = "Summer"
Case 4
b = "Autumn"
Case Else
b = "Error"
End Select
findSeason = b
End Function


Rate Simple way to start learning the enum statement



Private Sub Command1_Click()
seasonpoint = 2
Print findSeason(seasonpoint)
seasonpoint = Summer
Print findSeason(seasonpoint)
End Sub


Download this snippet    Add to My Saved Code

Simple way to start learning the enum statement Comments

No comments have been posted about Simple way to start learning the enum statement. Why not be the first to post a comment about Simple way to start learning the enum statement.

Post your comment

Subject:
Message:
0/1000 characters