View Single Post
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 10-21-2018 , 15:50   Re: How to allow empty statements?
Reply With Quote #3

Sorry, I mean, 1-st snippet cannot be compiled, because:

Quote:
1.sp(7) : error 036: empty statement
because empty {} is not permitted.

The question is just about convenient code formatting.

Maybe just use dummy:
Code:
public OnPluginStart()
{
	int a;

	if (!foo(0, a))
	if (!foo(1, a))
	if (!foo(2, a))
		dummy();
}

bool foo(int p1, int p2)
{
	return (p1 == p2);
}

void dummy() {}
So, maybe language provides simplier walkaround instead of "dummy"?

Well, don't pay attention. Stupid question.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline