VBScript dynamic includes

Output

I'm a variable
You called a function
You invoked a method
I'm from a child include request

Sources

include.vbscript.asp

<%@ language="VBScript" %>
<!--#include virtual="/lib/unit-tests.asp"-->
<link href="/lib/unit-tests.css" rel="stylesheet" type="text/css" />
<h1>VBScript dynamic includes</h1>
<h2>Output</h2>
<div class="code"><pre><%
 
function include(path)
    dim content : content = loadTextFile(path)
    if( content <> "File doesn't exists." ) then
        executeGlobal content
    end if
end function
 
include( Server.mapPath("include.structs.vbs") )
 
Response.write(variable & vbNewline )
Response.write(fn() & vbNewline)
 
dim C : set C = new Cls
Response.write( C.method() & vbNewline )
set C = nothing
 
Response.write( child_include )
 
%></pre></div>
<hr />
<h2>Sources</h2>
<h3>include.vbscript.asp</h3>
<div class="code"><%= geshify( loadTextFile( Server.mapPath("include.vbscript.asp") ), "asp" ) %></div>
<hr />
<h3>include.structs.vbs</h3>
<div class="code"><%= geshify( loadTextFile( Server.mapPath("include.structs.vbs") ), "asp" ) %></div>
<hr />
<h3>include.structs_2.vbs</h3>
<div class="code"><%= geshify( loadTextFile( Server.mapPath("include.structs_2.vbs") ), "asp" ) %></div>
 

include.structs.vbs

dim variable : variable = "I'm a variable"
 
function fn()
    fn = "You called a function"
end function
 
class Cls
 
    private sub Class_initialize
    end sub
 
    private sub Class_terminate
    end sub
 
    public function method()
        method = "You invoked a method"
    end function
 
end class
 
include( Server.mapPath("include.structs_2.vbs") )
 

include.structs_2.vbs

dim child_include : child_include = "I'm from a child include request"