'# '# Scripting example '# '# Reads and executes a DriveMonitor DNL file '# '# Datum: 12.11.2004 '# Option Explicit APP.LogActive = TRUE Dim fso Dim file Dim line Dim values Dim rgxp Dim dnlfile Set fso = CreateObject("Scripting.FileSystemObject") APP.Tools.FileBrowser.Open(".dnl") If APP.Tools.FileBrowser.FileName = "" Then WBScript.Quit dnlfile = APP.Tools.FileBrowser.FileName Set file = fso.OpenTextFile(dnlfile, 1) Set rgxp = New RegExp rgxp.Pattern = "^;.*" Do While file.AtEndOfStream <> True line = file.ReadLine If Len(line) > 0 Then If Not rgxp.Test(line) Then values = Split(line, "|", -1, 0) values(3) = Trim(values(3)) If Not Parameters(Int(values(0)), Int(values(1))).ReadOnly Then If Len(values(3)) = 16 Then Parameters(Int(values(0)), Int(values(1))) = DecFromBin(values(3)) Else Parameters(Int(values(0)), Int(values(1))) = values(3) End If End If End If End If Loop file.Close Function DecFromBin(str) Dim i Dim val val = 0 For i = 1 To 16 If StrComp(Mid(str, i, 1), "1") = 0 Then val = val + Exp(Log(2)*(16-i)) End If Next DecFromBin = Round(val) End Function