Hi,
The following script works if I insert a inputbox as srchstring within the function. How do I assign the srchstring as a variable that can call the function and get the value in the config.inf file? I hope i am explaining this properly.
many thanks
the config.inf file
IPADDRESS=10.0.0.1
<------------------------------------------------------->
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
Set oFile = FSO.OpenTextFile("c:\mfpconfig\config.inf")
srchString=search(IPADDRESS)
'<---------------- Search Function---------------------------->
Function search()
Do Until oFile.AtEndOfStream
strLine = oFile.ReadLine
If InStr(strLine, srchString) Then
strTmp = Split((strLine), "=")
End If
Loop
MsgBox strTmp(1)
End Function
The following script works if I insert a inputbox as srchstring within the function. How do I assign the srchstring as a variable that can call the function and get the value in the config.inf file? I hope i am explaining this properly.
many thanks
the config.inf file
IPADDRESS=10.0.0.1
<------------------------------------------------------->
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
Set oFile = FSO.OpenTextFile("c:\mfpconfig\config.inf")
srchString=search(IPADDRESS)
'<---------------- Search Function---------------------------->
Function search()
Do Until oFile.AtEndOfStream
strLine = oFile.ReadLine
If InStr(strLine, srchString) Then
strTmp = Split((strLine), "=")
End If
Loop
MsgBox strTmp(1)
End Function