WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Similar to SELECT CASE in LUA ? (https://www.wowinterface.com/forums/showthread.php?t=31816)

clam729 04-11-10 11:23 AM

Similar to SELECT CASE in LUA ?
 
Hello all - new to LUA here and still working on my first addon. In VBS/VBA I can use SELECT CASE - is there an equivalent in LUA ?

For example, if I did this, how could I achieve the same results in LUA (snippet - missing all declares, etc. - I can do that fine in LUA) :

Select Case intQuestType
Case 0
strQuestType = "123"
Case 1
strQuestType = "456"
Case 2
strQuestType = "789"
Case Else
strQuestType = "ABC"
End Select

Would I just use a series of IF/ELSEIFs ?

Slakah 04-11-10 11:30 AM

http://lua-users.org/wiki/SwitchStatement


All times are GMT -6. The time now is 01:36 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI