I am running some VBScripts locally on an XP machine, not as part of a web project.
In an effort to modularize & re-use some of my common functions/operations I'd like to call external VBS files. Something like:
Option Explicit
IncludeFile("C:\cDate_Operations.vbs")
Set oDate_Ops = New cDate_Operations
MsgBox oDate_Ops.CurrentDate_YYYY_Mmm_DD
Private Sub IncludeFile (ByVal FileName)
Const ForReading = 1
Set oFSO = CreateObject("Scripting.FileSystemObject")
Dim f: set f = oFSO.OpenTextFile(FileName, ForReading)
Dim s: s = f.ReadAll()
'***This line doesn't work!:
Set cDate_Operations = Eval(s)
End Sub
Anyone know how to do this? Thanks!
In an effort to modularize & re-use some of my common functions/operations I'd like to call external VBS files. Something like:
Option Explicit
IncludeFile("C:\cDate_Operations.vbs")
Set oDate_Ops = New cDate_Operations
MsgBox oDate_Ops.CurrentDate_YYYY_Mmm_DD
Private Sub IncludeFile (ByVal FileName)
Const ForReading = 1
Set oFSO = CreateObject("Scripting.FileSystemObject")
Dim f: set f = oFSO.OpenTextFile(FileName, ForReading)
Dim s: s = f.ReadAll()
'***This line doesn't work!:
Set cDate_Operations = Eval(s)
End Sub
Anyone know how to do this? Thanks!