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.

calculate groupadres
#1
Hi,

Is it possible to calculate a groupadres and use it to write a value?
Something like below?

I would write a value, depending on the month to a groupadres, but when it is november it has to write it to '56/1/151'
but when it is december i would write it to '56/1/161'


Code:
now = os.date('*t')
maand = now.month

calc = (maand -1) * 10
log(calc)
calc2 = 51 + calc
log(calc2)
new_groepsadres = '56/1/'..calc2
log(new_groepsadres)

grp.write('new_groepsadres', calc)
Reply
#2
This should work but you convert your calculated value to a string on line 11 so change 'new_groepsadres' into new_groepsadres without the ''
Reply
#3
Wow thanks Erwin, that looks less difficult than i thought.
And yes it is working, thanks.
Reply


Forum Jump: