variable

sarunas
2023-08-16
2023-08-16
  • sarunas - 2023-08-16

    Hello,
    I have a perhaps stupid question. I've noticed a lot of code where variables are named with an underscore. If I write it like this:

    VAR
            ValueToUInt                     :UINT;
    
    END_VAR
    

    AND

    VAR
            _ValueToUInt                        :UINT;
    END_VAR
    

    Is it the same or not? Is it nothing means? It is only convention.

     

    Last edit: sarunas 2023-08-16
  • TimvH

    TimvH - 2023-08-16

    It is a naming convention. Nothing else. Most often you see this being used for the local (private) variables of a Function Block. It comes mainly from C++ / C# to not mix them up with (public) properties. Probably best is to search for C++ naming conventions to get more information.

     

Log in to post a comment.