MacSig Posted December 13, 2008 Posted December 13, 2008 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.
RalphL Posted December 13, 2008 Posted December 13, 2008 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.
MacSig Posted December 13, 2008 Author Posted December 13, 2008 As I said it look cleaner to me. but definitely I can go without it
bcooney Posted December 13, 2008 Posted December 13, 2008 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.
MacSig Posted December 13, 2008 Author Posted December 13, 2008 Thanks Barbara for your point of view, it makes sense to me. As I said I can go with single scripts
MacSig Posted December 14, 2008 Author Posted December 14, 2008 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.
Recommended Posts
This topic is 6174 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now