PDA

View Full Version : استفاده از enum



Mo_hasan1366
دوشنبه 05 اسفند 1387, 00:49 صبح
با عرض سلام و خسته نباشید خدمت برنامه نویسان محترم
کاربرد enum داخل کلاس و بیرون کلاس چیه؟
و من چگونه می توانم از enum استفاده کنم
اگر زحمت نیست یک مثال هم بزنید

با تشکر

mostafaaa
دوشنبه 05 اسفند 1387, 10:05 صبح
سلام دوست من






If you have a set of unchanging values that are logically related to each other, you can define them together in an enumeration. This provides meaningful names for the enumeration and its members, which are easier to remember than their values. You can then use the enumeration members in many places in your code. This also improves the readability of your code because all the related values use the same enumeration name
.

Enum filePermissions
create = 1
read = 2
write = 4
delete = 8
End Enum
Dim file1Perm As filePermissions
file1Perm = filePermissions.create Or filePermissions.read