This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

get part of address
#1
Hi

How can I get a part of the group address inside a script using event.dst

Thank you
Reply
#2
What are you trying to do?
See this https://forum.logicmachine.net/showthrea...7#pid28967
------------------------------
Ctrl+F5
Reply
#3
(01.03.2023, 16:09)Daniel Wrote: What are you trying to do?
See this https://forum.logicmachine.net/showthrea...7#pid28967

automatically I would like to read the last part of the group address, for example /20 and then write, depending on the case, in another virtual tag that always ends with /20 if I could break down the script to be able to read the last part of the group address it would be perfect.

Thank you
Reply
#4
Use this:
Code:
parts = event.dst:split('/')

main = tonumber(parts[ 1 ])
middle = tonumber(parts[ 2 ])
sub = tonumber(parts[ 3 ])

log(main, middle, sub)
Reply


Forum Jump: