Good evening beloved developers,

for those still using C-Script (like me) I found a way faking switch () by using the while () instuction.

Maybe it looks a bit strange in the beginning, but it aviods those if () structures that look like chinese temples.


Code:
while (1) {
	// Case 1
	if (expression) {
		instructions
		break;
	}
	// Case 2
	if (expression) {
		instructions
		break;
	}
	// And so on...

	// Default part
	instructions
	break;
}


Last edited by ShoreVietam; 11/06/08 22:14.

My project Schlacht um Kyoto - Das Samurai Browsergame! (sorry, german only)