Page 1 of 1

Identifying :=

Posted: Mon Nov 09, 2020 9:05 pm
by Herrwolf1
I was reading through another script and came across two lines that I don't understand what's happening. I searched the help for ":=" but it didn't return any results. Can someone explain what's happening in the second line? I assume it's storing a value into the last index of an array.

smoothPeriod = 0.0
smoothPeriod:= (0.33 * period) + (0.67 * nz(smoothPeriod[1]))

Re: Identifying :=

Posted: Thu Nov 12, 2020 1:41 am
by Matthew
Hi Herrwolf!

That symbol := means "reassign". So if you declare a variable in your script and then want to change the value of that variable later, you need to use := to reassign the variable.

If you use = twice then the script won't compile and you'll get an error. Hope that helps :)