I'm creating a lined-up list of button boxes within a window (I don't know how many of them there are going to be until the script is actually run) as shown below. Obviously when I click on any one of the buttons, I need it to perform an action. That action however will be dependent upon the number of the button - so I need to know which button I've clicked... and unless I'm overlooking something obvious, I can't see an easy way to determine that. Can anyone tell me how I can do it, please?
Expr_Do_Something = expr(/* What can I type in here that will tell me which button I've pressed? */);
lub = lineupbox(ncol(4));
for(i=1, i<=12, i++, lub<< append(Button Box("Button "|| char(i), Expr_Do_Something)));
nw= new window("Test", lub);
Unfortunately there are reasons I can't do this with a different control like a combo box, which would simply return the item I select. It seems to me that what I really need is something like a "Current Active Button() << get button name" command, but I assume there isn't one - am I right?
Many thanks for any suggestions received.
[Footnote: I've just spotted a related discussion between "Volf", "Stig" and myself from a couple of years back which may well help with this at https://communities.sas.com/message/42855#42855, but I'll leave the question open anyway in case there are any other approaches to this]
Message was edited by: David Q/R