Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
Hello all, I have an array of objects, lets say MyArray[1..x] of Object.
When programming I want to have a more "readable" way of addressing each object. Instead of saying MyArray[1] := ...etc. I would like to say MyReadableName :=...
I've looked into references, but I'm worried a bit about the whole pointer stuff. How could I do this in a good way and support online change? And where should I put the declaration and assignment of the references, it could be many many hundreds, and I don't want to clutter the Main VAR window when in online mode?
Another thing I've looked at is having an enum with the readable names and using this as an index into the array. The lookup is then MyArray[Enum.MyReadableName] :=... but I'm not sure if thats is a good solution.
Hello all, I have an array of objects, lets say MyArray[1..x] of Object.
When programming I want to have a more "readable" way of addressing each object. Instead of saying MyArray[1] := ...etc. I would like to say MyReadableName :=...
I've looked into references, but I'm worried a bit about the whole pointer stuff. How could I do this in a good way and support online change? And where should I put the declaration and assignment of the references, it could be many many hundreds, and I don't want to clutter the Main VAR window when in online mode?
Another thing I've looked at is having an enum with the readable names and using this as an index into the array. The lookup is then MyArray[Enum.MyReadableName] :=... but I'm not sure if thats is a good solution.
Any solutions or hints are very welcome! Thanks!
Related
Talk.ru: 1