<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to The {define identifier string} macro</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/bab7a1225e/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/bab7a1225e/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/bab7a1225e/</id><updated>2020-02-27T23:13:34.449000Z</updated><subtitle>Recent posts to The {define identifier string} macro</subtitle><entry><title>The {define identifier string} macro</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/bab7a1225e/?limit=25#ca33" rel="alternate"/><published>2020-02-27T23:13:34.449000Z</published><updated>2020-02-27T23:13:34.449000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com3aecee0d7d97de9d942da225596fa4c8aa78ca87</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;this is probly version 3 so put your question downthere.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>The {define identifier string} macro</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/bab7a1225e/?limit=25#af50" rel="alternate"/><published>2020-02-27T23:13:32.809000Z</published><updated>2020-02-27T23:13:32.809000Z</updated><author><name>Steven666</name><uri>https://forge.codesys.com/u/steven666/</uri></author><id>https://forge.codesys.comcce68f04094891e02f167117241d735887b941bf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello everybody,&lt;/p&gt;
&lt;p&gt;I have a few problems with following code (see screenshots):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;First problem:&lt;/strong&gt; I define a new symbol replacement directive, but the compiler doesn't recognize the defined symbol "REPLACE_ME" after the pre-compiler has build it.&lt;br/&gt;
And he definitly pre-compiles this piece of code since I can see in the output that debug mode is enabled !&lt;br/&gt;
Does anybody know how to use the {define identifier string} macro ?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Further more I want to write my own ASSERT(x) macro which is only defined during debug mode, and wich takes 1 or 2 parameters for validation.&lt;br/&gt;
&lt;strong&gt;Second problem:&lt;/strong&gt; you can't define DEBUG outside PLC_PRG. I found this issue back in the help and I think this is a major limitation! How would it be possible to use my ASSERT(x) macro in other libraries??&lt;br/&gt;
&lt;strong&gt;Third problem:&lt;/strong&gt; It's not possible to use the symbol " {error '...'} " inside a {define identifier}. How can I display an error in the output?&lt;br/&gt;
&lt;strong&gt;Fourth problem:&lt;/strong&gt; in C++ you can convert x to a string using #, but how is this done in CoDeSys?&lt;br/&gt;
&lt;strong&gt;Fifth problem:&lt;/strong&gt; how can you define the identifier as a function, which takes 1 or more parameters?&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks for all help and comments !&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: define.png" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=501"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Assert.png" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=500"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>