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: 666
_________________________
Uomo Del Ghiaccio
--------------------

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

Registered: 09/06/00
Posts: 1928
Loc: Objectif Lune, Montreal, Qc
This already exists in VBScript.
Use something like the following:
Code:
Option Explicit
Dim MyClasses, fso, sContents
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyClasses = fso.OpenTextFile("MyClasses.vbs",1) 
sContents = MyClasses.ReadAll 
MyClasses.Close 
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

Top