Ticket Face Code Pick

The Arts Management web page for ticket code is good. In the help pages search “jst” and you will get the page you need.

pick(number,value0,value1,[value2]…)
Selects an item from a list of string or numeric values. The number argument is rounded to an integer and used to select the item. value0 is returned if the result is 0, value1 if the result is 1, value2 if the result is 2, and so on. If the number is less than zero or greater than the number of values in the list, then an empty value is returned. The list of values can be a mixture of string and numeric values.

pick(2,‘A’,‘B’,‘C’,‘D’) returns ‘C’
pick(2>4,‘A’,‘B’,‘C’,‘D’) returns ‘A’, as 2 is not greater than 4, thus it is False, where False equals 0.
pick(2<4,‘A’,‘B’,‘C’,‘D’) returns ‘B’, as 2 is less than 4, thus it is True, where True equals 1.
pick(pos(‘A’,‘DEF’)>0,‘Price Not Found’,‘Price Found’) returns ‘Price Not Found’
pick(pos(‘A’,‘ABC’),‘Price Not Found’,‘Price A’,‘Price B’,‘Price C’) returns ‘Price A’

How I have used it…
If (X) and (Y) then “Z”
pick((PB_SHOW_CODE=‘17-RHS’&PS_PRICE_CODE=‘X’),’ ‘,‘VIP Pass’)
pick((PB_SHOW_CODE=‘18-LFV’&SC_DESCRIPTION=‘Lobster Option’),’ ',‘Lobster Option’)

If (X) and (Y) then “Z” else “Q”
pick((PB_SHOW_CODE=‘17-RHS’&PS_PRICE_CODE=‘X’),‘Q’,‘Z’)

If (X) then “Z” else “Q”
pick((PB_SHOW_CODE=‘17-ASE’),'Q ',‘Z’)

Pick in combination with other statements
If (XY), = XY, then ‘Lablel X’,‘Label Y’)
pick(pos(PS_PRICE_CODE,‘ACF’),PS_PRICE_CODE,‘Adult’,‘Child’)

If (X or Y or Z), then (‘A’)
pick(pos(PS_PRICE_CODE,‘B,P,L’)=0,‘Senior’)

Center any command with output
jst((pick(pos(PS_PRICE_CODE,‘ACS’),PS_PRICE_CODE,‘Adult’,‘Youth’,‘Senior’)),’^20x’)

4 Likes