cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
354
Views
0
Helpful
4
Replies

UCCX scripting

j.huizinga
Level 6
Level 6

Hi,

I have UCCX 10.6 and I have a question about scripting.

When I have an integer like 5 10 or 15 I can use a switch statement to make a decision. But what if I have to make a decision if a value is between 5 and 10 or between 10 and 15?

This can be solved with nested if statements, but I was wondering if there is someone who came up with a better (easier) way of check a value.

Thanks

JH

4 Replies 4

Chris Deren
Hall of Fame
Hall of Fame

I am not aware of cleaner method, "if X<10 && X>5 where && stands for AND would cover one scenario.

Hello Chris,

Yes I am using && and I ended up with 10 nested IF statements. It does do the job, but it's a little ugly.

Thanks for your input

Jan

Unless someone can propose some Java code you could use there is no native way with pre-defined steps to accomplish this AFAIK.

I could give you some Java code you could slip into a do or set step, but that would be equally ugly :-)

Also based on the outcome of the IFs, you want to do something (I presume)... the IF statements give you somewhere to put those steps.

In terms of layout, I prefer:

IF (x > 0 && < 5)

- True: do this

- False: do that

IF (x > 5 && < 15)

- True: do this

- False: do that

IF (x > 15 && < 25)

- True: do this

- False: do that

... etc

Rather than:

IF (x > 0 && < 5)

- True: do this

- False: do that

-- IF (x > 5 && < 15)

--- True: do this

--- False: do that

---- IF (x > 15 && < 25)

----- True: do this

----- False: do that

..etc

.. i.e. count on the fact that once an if branch has been followed, the next step down will execute - you don't have to nest them in, I think having them laid out sequentially aids readability.

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!