Topic Options
#29762 - 12/05/08 09:42 AM VB Script Load Class function
Uomo Del Ghiaccio Offline
OL Expert

Registered: 02/21/01
Posts: 668
Uomo Del Ghiaccio

#29763 - 12/05/08 01:05 PM Re: VB Script Load Class function
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1975
Loc: Objectif Lune, Montreal, Qc
This already exists in VBScript.
Use something like the following:
Option Explicit
Dim MyClasses, fso, sContents
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyClasses = fso.OpenTextFile("MyClasses.vbs",1) 
sContents = MyClasses.ReadAll 
ExecuteGlobal sContents
This achieves the same results. The ExecuteGlobal statement makes every class defined in the external script available to all subs and functions within the calling script.
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen