Forum

> > CS2D > Scripts > Is there a switch like function in Lua?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Is there a switch like function in Lua?

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Is there a switch like function in Lua?

DannyDeth
User Off Offline

Zitieren
Well, I would like to know if there was a function similar to the "switch" from C:
1
2
3
4
5
switch(variable) {
	case 1: printf("1\n"); break;
	case 2: printf("2\n"); break;
	case default: printf("Not one or two\b"); break;
}
Well, not tht exactly but something similar, I'm tired of using a continous line of if statements to test the same varibable
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht