I have one ActionCanExecute() function which is provided by the tool and triggers this action when user perform any action in the tool. My question is which approach is better?
1. In ActionCanExecute() use SELECT statement for each action and create / call function / sub within Actioncanexecute()
e.g
2. In ActionCanExecute() use SELECT statment for each action and create function/sub outside of the Actioncanexecute() and called from actioncanexecute() and called function stored in actioncanexecute which returns true / false.
e.g
3. In ActionCanExecute() use SELECT statement and execute block of code right after each case in the structure
e.g
Can anyone please guide me which approach is better 1 or 2 or 3 1. Call function/sub within ActionCanExecute() 'Here we return ActionCanExecute from function/sub 2. Call function/sub outside of ActionCanExecute() 'Here we return ActionCanExecute by calling function/sub 3. Write code without creating function/sub 'Here we return ActionCanExecute after each block of code within case statement
you can't nest Subs/Functions in VBScript. Whether to do the work inline in ActionCanExecute() or in extra Functions/Subs depends on the size of the code (will ActionCanExecute() get so big/long that it isn't easy to read/understand) and on the number of calls to those functions.