# Including Scripts

This guide discusses how to include or use functions from another source file in RhinoScript.

## Problem

In programming languages like C/C++ and C#, there are statements like #include and using where you can reference functions from other source files. This is often used when you want to build a library of common functions that can be used from within other scripts,

VBScript does not have an equivalent to the C/C++ #include statement. But, its possible to write your own include-type function.

## Solution

The following subroutine can be used to include scripts…

' ---------------------------------------------------------------------------
' Subroutine:  Include
' Purpose:     Includes, or loads, other RhinoScript files
' Argument:    A script file name to include
' Example:     Call Include("C:\Scripts\MyScriptFile.rvb")
' ---------------------------------------------------------------------------
Sub Include(strScriptName)
Dim objFSO, objFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strScriptName)