Procedures / Functions

Is it possible to define a procedure or a function which will run when called from another script? E.g.:
in the global code, and
in a script called by an action.
- Code: Select all
procedure doSomething(var){
//Do something
}
in the global code, and
- Code: Select all
doSomething(1);
in a script called by an action.