# Using subroutines in script

**URL:** https://www.finalbuilder.com/forums/t/using-subroutines-in-script/566
**Category:** Discussion
**Created:** [August 17, 2007, 3:43am UTC](https://www.finalbuilder.com/forums/t/using-subroutines-in-script/566 "2007-08-17T03:43:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![paulstock](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/paulstock/32/45_2.png) [@paulstock](https://www.finalbuilder.com/forums/u/paulstock)
#### Post date: [August 17, 2007, 3:43am UTC](https://www.finalbuilder.com/forums/t/using-subroutines-in-script/566/1 "2007-08-17T03:43:35Z")

</div>

I've got a fairly complex VB script that I'm writing in FB that would be greatly simplified if I could divide the code into subroutines.&nbsp; But, I'm not sure how to do that.&nbsp; Can you use subroutines or functions within a script?

Thanks

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [August 18, 2007, 2:37am UTC](https://www.finalbuilder.com/forums/t/using-subroutines-in-script/566/2 "2007-08-18T02:37:45Z")

</div>

Hi Paul   
  
 Yes you can, have a look a the project menu, there is a menu item called “Project Global Script”, you can add functions and subroutines in there for both VBScript and JavaScript. These functions can then be called from the action script events.
