Zitat:
C0185: It is not possible to perform component access '.', index access '[]' or call '()' on result of function call. Assign result to help variable first.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using dot operator of a struct property is not supported, which makes the property painful to use.
I see no reason why this is not supported.
The dot operator can be used directly on the return value of a method by typing the method name twice (which is suggested by the auto complete).
Another maybe unrelated point: why the private local data of a function block can be read from outside?
Shouldn't the compiler prevent it?
Following is an example to make my point clear:
Originally created by: D. Kugler
if you are missing the SmartCoding functionality for dots, check settings at Tools-->Options-->SmartCoding..
He is clearly missing the feature of directly using a struct member of a struct property.
However, using a member of a struct of a method return value does NOT work for me as well.
Indeed dosent work;
You are correct.
Return value of a method normally also does not work.
However, by typing the method name twice, which is suggested by the code auto complete, it shows no error any more.
I just attached an example.
However, using a member of a struct of a method return value does NOT work for me as well.
Thank you for your reply.
But that is not my point.
This works. Beware that the property is writeable doing this (Set-property not needed)
Thanks for the workaround.
Hope 3S will provide an official support.