Page 1 of 1

Time user variable

Posted: Monday 02 November 2020 19:07
by PSUtec
Hi,
I've created a user variable VH1, type time, value 05:00.
How can I assign a new value (e.g. 06:00) to this variable in a script?
I've tried:
- dz.variables('VH1').value='06:00'
- dz.variables('VH1').time.hour=6
- dz.variables('VH1') .time='06:00'
- dz.variables('VH1')=dz.variables('VH1').addHours(1)

No error, but no change!
Some idea to solve this problem?

Thanks in advance,

Re: Time user variable  [Solved]

Posted: Monday 02 November 2020 19:20
by waaren
PSUtec wrote: Monday 02 November 2020 19:07 I've created a user variable VH1, type time, value 05:00.
How can I assign a new value (e.g. 06:00) to this variable in a script?
as described in the wiki page on this. To set a variable to a value use the method set.

So here you would use

Code: Select all

dz.variables('VH1').set('06:00')

Re: Time user variable

Posted: Tuesday 03 November 2020 8:30
by PSUtec
Thanks for this fast answer.

I had tried dz.variables('VH1').time.set('06:00') which causes an error.