I would like to have a pull down menu that will allow me to assign a value to a variable.
I have created a two column Array where the first column is DESCRIPTION and the second column is the NAME of a file.
The Array is 10 rows long.
When I scroll down the array when I find the description I want I want it to grab the corresponding NAME of that file and assign it to a variable that will be used in other procedures.
I’ve tried the “Popup Button Options” without success. I have had success with “Popup Button Options” when “hard wired” but not when it is a variable.
I have confirmed that the variable is a two column array with this case having 10 rows.
Now for the Popup Menu Button Options I have Data set to menuOut, Data Source set to Field/Variable and Mode set to Formula. In the Formula pane I have:
Now the Popup Button only shows the first column of the testMenu variable for choosing (the Description in your example). Once chosen, the attached procedure searches the first column of testMenu for the value of menuOut that has been selected and uses that value to find the corresponding compound element of in the testMenu array. It then extracts the second or last part of that element. Now when you select Seven from the popup list, fileOut will have a value of Something7.
You can change the separators to the ones you are currently using. The only problem may be if you have two Descriptions with the same exact value.
Gary, I have to hand it to you. When I read the original question, I didn’t understand it and I thought it was impossible. However, I was just misreading it. Fortunately you did not do that.
Now that you’ve helped me understand the actual question, I have a slight improvement on the answer. In the Procedure panel I think it would be much simpler to use the arraylookup( function, which is designed for exactly this purpose.