December 13, 200817 yr Hello guys, I have a bunch of buttons that perform different scripts and I would like to organize them within a single script (looks neater to me) so my idea was to pass as a parameter the name of the subscript to perform. Basically the button "create" performs the script "button manager" passing as a parameter "create a new record", the button "delete" performs the script "button manager" passing as a parameter "delete a record" and so on ... Within "button manager" instead having a bunch of if else if I would like to perform the subscript with the same name of the parameter. is it possible? something like perform script [Get(ScriptParameter)]. Thanks and have a nice day.
December 13, 200817 yr Even if it was possible to use a script parameter with the Perform Script step, what would you gain. All you have done is added another script and a lots of complexity.
December 13, 200817 yr I don't think heading in the direction of one complex script with parameters is the way to go. I did that at first, and lived to regret it. I makes debugging much more difficult, since a change in the script could affect a broad range of functionality. How you organize scripts is personal preference. I'm all for modularity, and subscripts. But use them knowingly. Overall, short scripts that are literal are the easiest to come back to months later.
December 13, 200817 yr Author Thanks Barbara for your point of view, it makes sense to me. As I said I can go with single scripts
December 14, 200817 yr Author Hi there, actually this morning I was doing several things at the same time and I lost my point. Now, I'm reviewing my solution and the point come out again: I have a portal that shows actions (the actions table has 2 field name and script) I display the name on the button and I would like to perform dynamically the script called like the value stored in script field. Is there a web-compatible way to do that? My idea was to pass the field value as a parameter to "button manager" and to perform the script I need as a subscript. This is the reason why I asked if I can perform the subscript called like the parameter I pass to. Thanks and have a nice day.
Create an account or sign in to comment