Hello!
I am looking for help with setting a variable from two other variables.
Here my current test.vbs (the attachment upload failed); the commented 'WScript.Echo' in line 28 works fine, but in line 29, I fail to set the variable - I assume because of a quoting or escaping mistake:
[pre]
################## test.vbs ##################
Dim StrLine
Dim FSO
Dim TSO
Dim StrLineElements
Dim Index
Dim i
Dim Delimiter
Set FSO = CreateObject("Scripting.FileSystemObject")
Set TSO = FSO.OpenTextFile(".\test.ini")
Delimiter="="
Index = 1
'Do While TSO.AtEndOfStream = False
' StrLine = TSO.ReadLine
' StrLineElements = Split(StrLine, Delimiter)
' For i = LBound(StrLineElements) To UBound(StrLineElements)
' WScript.Echo StrLineElements(i)
' next
' Index = Index + 1
'Loop
Do While TSO.AtEndOfStream = False
StrLine = TSO.ReadLine
StrLineElements = Split(StrLine, Delimiter)
For i = LBound(StrLineElements) To UBound(StrLineElements)
next
' WScript.Echo (StrLineElements(0) & "=" & StrLineElements(1))
set StrLineElements(0) = StrLineElements(1)
Index = Index + 1
Loop
TSO.Close
##############################################
[/pre]
The referenced 'test.ini' needs to reside in the same directory:
[pre]
################## test.ini ##################
service="C:\Program Files\Notepad++\notepad++.exe"
parameters=""
interval=60
delay=10
trayicon="true"
##############################################
[/pre]
Thanks a lot!
I am looking for help with setting a variable from two other variables.
Here my current test.vbs (the attachment upload failed); the commented 'WScript.Echo' in line 28 works fine, but in line 29, I fail to set the variable - I assume because of a quoting or escaping mistake:
[pre]
################## test.vbs ##################
Dim StrLine
Dim FSO
Dim TSO
Dim StrLineElements
Dim Index
Dim i
Dim Delimiter
Set FSO = CreateObject("Scripting.FileSystemObject")
Set TSO = FSO.OpenTextFile(".\test.ini")
Delimiter="="
Index = 1
'Do While TSO.AtEndOfStream = False
' StrLine = TSO.ReadLine
' StrLineElements = Split(StrLine, Delimiter)
' For i = LBound(StrLineElements) To UBound(StrLineElements)
' WScript.Echo StrLineElements(i)
' next
' Index = Index + 1
'Loop
Do While TSO.AtEndOfStream = False
StrLine = TSO.ReadLine
StrLineElements = Split(StrLine, Delimiter)
For i = LBound(StrLineElements) To UBound(StrLineElements)
next
' WScript.Echo (StrLineElements(0) & "=" & StrLineElements(1))
set StrLineElements(0) = StrLineElements(1)
Index = Index + 1
Loop
TSO.Close
##############################################
[/pre]
The referenced 'test.ini' needs to reside in the same directory:
[pre]
################## test.ini ##################
service="C:\Program Files\Notepad++\notepad++.exe"
parameters=""
interval=60
delay=10
trayicon="true"
##############################################
[/pre]
Thanks a lot!