<?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/Engineering/thread/1481ca9164/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/1481ca9164/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/1481ca9164/</id><updated>2020-02-27T14:22:26.874000Z</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/Engineering/thread/1481ca9164/?limit=25#fc6b" rel="alternate"/><published>2020-02-27T14:22:26.874000Z</published><updated>2020-02-27T14:22:26.874000Z</updated><author><name>Steven666</name><uri>https://forge.codesys.com/u/steven666/</uri></author><id>https://forge.codesys.com2648f0c7fb80e882f503610cdc41d9634f7674f0</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=503"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Assert.png" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=502"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>