<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Please support dot operator of a struct property</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a8a0ec3526/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a8a0ec3526/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/a8a0ec3526/</id><updated>2020-02-27T14:21:24.102000Z</updated><subtitle>Recent posts to Please support dot operator of a struct property</subtitle><entry><title>Please support dot operator of a struct property</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a8a0ec3526/?limit=25#1a0c" rel="alternate"/><published>2020-02-27T14:21:24.102000Z</published><updated>2020-02-27T14:21:24.102000Z</updated><author><name>kai-sew</name><uri>https://forge.codesys.com/u/kai-sew/</uri></author><id>https://forge.codesys.comea946c024ef85b5c8772ede8d0fd1e335cbd2364</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks for the workaround.&lt;/p&gt;
&lt;p&gt;Hope 3S will provide an official support.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;somlioy hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
This works. Beware that the property is writeable doing this (Set-property not needed)&lt;/p&gt;
&lt;/blockquote&gt;&lt;/div&gt;</summary></entry><entry><title>Please support dot operator of a struct property</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a8a0ec3526/?limit=25#99e9" rel="alternate"/><published>2020-02-27T14:21:22.941000Z</published><updated>2020-02-27T14:21:22.941000Z</updated><author><name>somlioy</name><uri>https://forge.codesys.com/u/somlioy/</uri></author><id>https://forge.codesys.coma6539710bad87e56840d3c1c0d9315b9daca5f5a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;This works. Beware that the property is writeable doing this (Set-property not needed)&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: example.png" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=4693"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Please support dot operator of a struct property</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a8a0ec3526/?limit=25#79a0" rel="alternate"/><published>2020-02-27T14:21:22.532000Z</published><updated>2020-02-27T14:21:22.532000Z</updated><author><name>kai-sew</name><uri>https://forge.codesys.com/u/kai-sew/</uri></author><id>https://forge.codesys.comcc56f5ca15040f53d6fbe51156d2d02a360b7082</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you for your reply.&lt;/p&gt;
&lt;p&gt;But that is not my point.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;D. Kugler hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
if you are missing the SmartCoding functionality for dots, check settings at Tools--&amp;gt;Options--&amp;gt;SmartCoding..&lt;/p&gt;
&lt;/blockquote&gt;&lt;/div&gt;</summary></entry><entry><title>Please support dot operator of a struct property</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a8a0ec3526/?limit=25#35ea" rel="alternate"/><published>2020-02-27T14:21:22.095000Z</published><updated>2020-02-27T14:21:22.095000Z</updated><author><name>kai-sew</name><uri>https://forge.codesys.com/u/kai-sew/</uri></author><id>https://forge.codesys.com488c0e1e7e6d2d76e05308b06103956e3758f246</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;You are correct.&lt;/p&gt;
&lt;p&gt;Return value of a method normally also does not work.&lt;/p&gt;
&lt;p&gt;However, by typing the method name twice, which is suggested by the code auto complete, it shows no error any more.&lt;/p&gt;
&lt;p&gt;I just attached an example.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;jago85 hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
He is clearly missing the feature of directly using a struct member of a struct property.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;_fb&lt;/span&gt;.&lt;span class="nv"&gt;structProperty&lt;/span&gt;.&lt;span class="nv"&gt;xStructMember&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;TRUE&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="nv"&gt;something&lt;/span&gt;
&lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;However, using a member of a struct of a method return value does NOT work for me as well.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;_fb&lt;/span&gt;.&lt;span class="nv"&gt;structMethod&lt;/span&gt;&lt;span class="ss"&gt;()&lt;/span&gt;.&lt;span class="nv"&gt;xStructMember&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="nv"&gt;something&lt;/span&gt;
&lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>Please support dot operator of a struct property</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a8a0ec3526/?limit=25#60ca" rel="alternate"/><published>2020-02-27T14:21:20.725000Z</published><updated>2020-02-27T14:21:20.725000Z</updated><author><name>somlioy</name><uri>https://forge.codesys.com/u/somlioy/</uri></author><id>https://forge.codesys.com278abca75977d52276bc1c253121c33fedc9fb2c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;fb&lt;/span&gt;.&lt;span class="nv"&gt;Prop&lt;/span&gt;.&lt;span class="nv"&gt;xBool&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
   &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nv"&gt;something&lt;/span&gt;
&lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Indeed dosent work;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Zitat:&lt;/strong&gt;&lt;br/&gt;
    C0185: It is not possible to perform component access '.', index access '[]' or call '()' on result of function call. Assign result to help variable first.&lt;/p&gt;
&lt;/blockquote&gt;&lt;/div&gt;</summary></entry><entry><title>Please support dot operator of a struct property</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a8a0ec3526/?limit=25#ebfc" rel="alternate"/><published>2020-02-27T14:21:20.295000Z</published><updated>2020-02-27T14:21:20.295000Z</updated><author><name>jago85</name><uri>https://forge.codesys.com/u/jago85/</uri></author><id>https://forge.codesys.com8a14bb365ab8f540abceb04507a1da332fd51939</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;He is clearly missing the feature of directly using a struct member of a struct property.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;_fb&lt;/span&gt;.&lt;span class="nv"&gt;structProperty&lt;/span&gt;.&lt;span class="nv"&gt;xStructMember&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;TRUE&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="nv"&gt;something&lt;/span&gt;
&lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;However, using a member of a struct of a method return value does NOT work for me as well.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;_fb&lt;/span&gt;.&lt;span class="nv"&gt;structMethod&lt;/span&gt;&lt;span class="ss"&gt;()&lt;/span&gt;.&lt;span class="nv"&gt;xStructMember&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="nv"&gt;something&lt;/span&gt;
&lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>Please support dot operator of a struct property</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a8a0ec3526/?limit=25#31cd" rel="alternate"/><published>2020-02-27T14:21:19.879000Z</published><updated>2020-02-27T14:21:19.879000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com738e402b9f99154e6ee06c5fe764b91e820ec625</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; D. Kugler&lt;/p&gt;
&lt;p&gt;if you are missing the SmartCoding functionality for dots, check settings at Tools--&amp;gt;Options--&amp;gt;SmartCoding..&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Dot.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=4676"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Struct.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=4675"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Please support dot operator of a struct property</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a8a0ec3526/?limit=25#2371" rel="alternate"/><published>2020-02-27T14:21:18.713000Z</published><updated>2020-02-27T14:21:18.713000Z</updated><author><name>kai-sew</name><uri>https://forge.codesys.com/u/kai-sew/</uri></author><id>https://forge.codesys.come4f34d0d6bebc8baa9d609d58a10484c1c335fe2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Using dot operator of a struct property is not supported, which makes the property painful to use.&lt;/p&gt;
&lt;p&gt;I see no reason why this is not supported. &lt;/p&gt;
&lt;p&gt;The dot operator can be used directly on the return value of a method&lt;span style="color: #FF0000;"&gt; by typing the method name twice&lt;/span&gt; (which is suggested by the auto complete).&lt;/p&gt;
&lt;p&gt;Another maybe unrelated point: &lt;span style="color: #FF0000;"&gt;why the private local data of a function block can be read from outside&lt;/span&gt;? &lt;br/&gt;
Shouldn't the compiler prevent it?&lt;/p&gt;
&lt;p&gt;Following is an example to make my point clear:&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: stfoo.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=4685"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: GetFoo.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=4686"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: prgfoo.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=4689"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>