Conditional execution of display list

Is there any mechanism in OpenGL that enables conditional execution of display lists? What I mean is (for example):
I define a display list that draws a cube and send it to the server. Then I want to send a boolean flag that tells the server wether to draw or not the display list. I want that the display list definition would not be destroyed (destroying and defining an empty list is a trivial solution
but that is not what I mean). In any case the display list should be called but executed acording to the flag state.

Why don’t you just perform the check yourself?

if (myBooleanIsTrue)

[This message has been edited by harsman (edited 05-23-2001).]

Thanks Harsman, but I meant something else. I will try to rephrase the question.
Is there any conditional exection of commands in OpenGL?
Can I send to the server something like:

And then send to the server:
glSetConditionFlag(glFlagX, TRUE)
Generally: Is there if/else statements in OpenGL?
I guess not, but it would be nice if such mechanism exists.

There isn’t a “conditional execution statement”… everything in a display list when it is compiled is executed when it is run (at least, those commands that can go in a DL). To do what you describe, just use two display list, and do the check yourself, as mentioned by harsman. I can’t imagine a situation when this wouldn’t be an acceptable way to go about it.