<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>if else in a CFG file</title><link>https://communities.bentley.com/products/administration/f/product-administration-forum/192630/if-else-in-a-cfg-file</link><description>how can I use the below in a .cfg file % if $ (USERNAME) == &amp;quot;nvancaspel&amp;quot; || $ (USERNAME) == &amp;quot;bpunt&amp;quot; % if exists ($ (_ MS_CONFIG_HOORN_COF) Optimize_admin_CE.cfg) % include $ (_ MS_CONFIG_HOORN_COF) Optimize_admin_CE.cfg else % if exists ($ (_ MS_CONFIG_HOORN_COF</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: if else in a CFG file</title><link>https://communities.bentley.com/thread/571484?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2020 17:48:42 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:ed0ec9eb-8c17-43e4-aa2c-71d8b9daebc2</guid><dc:creator>Rod Wing</dc:creator><description>&lt;p&gt;Your syntax is a bit off as you&amp;#39;ve got some spaces where you shouldn&amp;#39;t have. Your&amp;#39;e also missing an %endif&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also be aware that the text comparisons are case sensitive. In the $(USERNAME) evaluation used in the first line the case of the usernames has to be an exact case match. bpunt, BPUNT, and Bpunt are all different.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;%if $(USERNAME) == &amp;quot;nvancaspel&amp;quot; || $(USERNAME) == &amp;quot;bpunt&amp;quot;
  %if exists ($(_MS_CONFIG_HOORN_COF)Optimize_admin_CE.cfg)
     %include $(_MS_CONFIG_HOORN_COF)Optimize_admin_CE.cfg
   %else 
     %if exists ($(_MS_CONFIG_HOORN_COF)Optimize.cfg)
        %include $(_MS_CONFIG_HOORN_COF)Optimize.cfg
     %endif
  %endif
%endif&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: if else in a CFG file</title><link>https://communities.bentley.com/thread/569598?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2020 18:09:58 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:7a537d2d-8b81-412b-a08c-8d43b86d9f9e</guid><dc:creator>Mark Anderson</dc:creator><description>&lt;p&gt;The configuration file syntax supports both %else and %elif conditions.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;mark anderson&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: if else in a CFG file</title><link>https://communities.bentley.com/thread/569546?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2020 14:04:23 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:bdab1e25-8999-4380-9e41-cbe3303f9de8</guid><dc:creator>Jan Šlegr</dc:creator><description>&lt;p&gt;Hi Nico,&lt;/p&gt;
&lt;p&gt;please be aware this is general programming forum, whereas you question is about product configuration. Because of that, I recommend to move your post to &lt;a href="/products/administration/f/product-administration-forum" rel="noopener noreferrer" target="_blank"&gt;Product administration&lt;/a&gt;. To move existing post, use &lt;em&gt;More &amp;gt; Move&lt;/em&gt; tool under your original post.&lt;/p&gt;
&lt;p&gt;Also, please read and follow &lt;a href="/help/w/be_communities_help/4413/communities-forums-best-practices-and-tips" rel="noopener noreferrer" target="_blank"&gt;Communities best practices&lt;/a&gt;, because even basic information are missing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What product do you use?&lt;/li&gt;
&lt;li&gt;What version?&lt;/li&gt;
&lt;li&gt;What does it mean &amp;quot;how can I use?&amp;quot; ... what is your intention?&lt;/li&gt;
&lt;li&gt;What is expected result or your requirement?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also, edit your post and use &lt;em&gt;Insert &amp;gt; Insert code&lt;/em&gt; (with text formatting) to ensure the configuration will be displayed better formatted.&lt;/p&gt;
&lt;p&gt;With regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>