If you are using lite-c pure mode and don't want to write if else statements for like 5 comparisons or more, I suggest you learn how to use switch statements.

Here is some code that demonstrates what I mean:
Code:
#include <acknex.h>
#include <default.c>

var foo = 0;
var bar;

PANEL* pnMain = {
	digits(0,0,"Foo = %0.f","Arial#24",1,foo);
	flags = SHOW;
}

function main(){
	video_mode = 7;				//800x600
	
	while(1){
		switch(bar){
			case 1:				//if(bar == 1){
				foo = 1;		//foo = 1;
				break;			//}
			case 2:				//else if(bar == 2){
				foo = 3;		//foo = 3;
				break;			//}
			case 3:				//else if(bar == 3){
				foo = 2;		//foo = 2;
				break;			//}
			case 5:				//else if(bar == 5){
				foo = 30;		//foo = 30;
				break;			//}
			default:			//else{
				foo = 500;		//foo = 500;
				break;			//}
		}
		wait(1);
	}
}



The comments basically explain everything.
The first case is the first if statement. The cases following that are the else ifs. The the default becomes the final else. You can omit the break from the default but you can't omit it from any case. If you do, you will end up finding out that if you take out the break from case 3:, foo will be 30. This is because Lite-C compares bar to the cases one by one. Once it's in a case, it will run everything under it without checking so you must break from the statement. If you do not know what break is, break simply exits from the switch, while, do while, or for loop it is in.

I highly recommend that you use switch statements if you have more than 5 if elses.

The source is attached.

Attached Files
switch.rar (22 downloads)
Switch source