Hi,
Working on a new AR and it keeps telling me that it needs a Close Parenthesis. I've checked this thing over and over and don't see any missing. It is based on another script that works - hence my confusion. Says it is on the first 'else if' line.
Thanks!
Solved! Go to Solution.
Line 16 uses "or" instead of "||", that might be leading to the error message.
You're also using the assignment operator "=" when you should be using the equality operator "==" in a bunch of places, that'll usually lead to bugs if it also isn't causing a syntax error.
Line 16 uses "or" instead of "||", that might be leading to the error message.
You're also using the assignment operator "=" when you should be using the equality operator "==" in a bunch of places, that'll usually lead to bugs if it also isn't causing a syntax error.
I knew it was something silly that I was missing. That one has tripped me up several times - you'd think that I would learn to look for that one 😜
Thanks!
In addition to @DavidSolari 's advice, you might also try using the function When. It works the same as a big if/else block, but it's more concise.
return When(
addrtype == 1, 'A',
addrtype == 3 && addrsub = 'PRESUB' && !IsEmpty(unit), 'R',
// and so on. the last line is the default "else" option
addrstat
)
I'll give this a try in the future, needed to get it working and in the hands of testers quickly.
Thanks.