# Conditional Compilation: How to use @if blocks

**URL:** <https://forum.dynare.org/t/conditional-compilation-how-to-use-if-blocks/383>\
**Category:** Dynare help (legacy posts)\
**Created:** [3 July 2007 22:41 UTC](https://forum.dynare.org/t/conditional-compilation-how-to-use-if-blocks/383 "2007-07-03T22:41:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jd\_prada](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/a183cd/32.png) [@jd\_prada](https://forum.dynare.org/u/jd_prada)\
**Post date:** [3 July 2007 22:41 UTC](https://forum.dynare.org/t/conditional-compilation-how-to-use-if-blocks/383/1 "2007-07-03T22:41:29Z")

</div>

Hi

I am having trouble using the conditional compilation @define,@if,@elseif,@else,@end.

My question is: where can I use this conditional compilation?

Because I have a model with many “options”: for example, I would like to choose between a model without price-stickiness and one with price-stickiness. The difference between them is a couple of equations and new variables. I would like to have them both written in the same \*.mod file. I thougth that using a @if block would help me: something like  
@define version 1;  
…  
model;  
@if version == 1;  
equations with price stickiness…  
@else;  
equations without price stickiness…  
@end;

I couldn’t do that. Is this possible? Which is the correct use for the @if block?

Thanks

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://forum.dynare.org/user_avatar/forum.dynare.org/micheljuillard/32/5318_2.png) [@MichelJuillard](https://forum.dynare.org/u/MichelJuillard)\
**Post date:** [18 July 2007 19:58 UTC](https://forum.dynare.org/t/conditional-compilation-how-to-use-if-blocks/383/2 "2007-07-18T19:58:19Z")

</div>

Conditional compilation isn’t available yet in version 4.

Sorry

Michel
