how can I use the below in a .cfg file% if $ (USERNAME) == "nvancaspel" || $ (USERNAME) == "bpunt" % 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
Hi Nico,
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 Product administration. To move existing post, use More > Move tool under your original post.
Also, please read and follow Communities best practices, because even basic information are missing:
Also, edit your post and use Insert > Insert code (with text formatting) to ensure the configuration will be displayed better formatted.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
The configuration file syntax supports both %else and %elif conditions.
HTH,
mark anderson
Your syntax is a bit off as you've got some spaces where you shouldn't have. Your'e also missing an %endif
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.
%if $(USERNAME) == "nvancaspel" || $(USERNAME) == "bpunt" %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
Rod WingSenior Systems Analyst