here's my wordfile (well, the important bit any way)
/L15"VBScript" Line Comment = ' File Extensions = VBS WSF
/Function String = "^{Sub^}^{Function^} [a-z,A-Z,0-9,_, ,(,)]+$"
/Delimiters = .(),-+=|\/{}[]:;"'< >
/Indent Strings = "Then" "Do" "For Each" "For" "Else" "ElseIf"
/Indent Strings SOL = "For" "Do" "Select Case" "Case"
/Unindent Strings = "End" "Next" "Else" "ElseIf" "End If" "End Select" "End Sub" "Wend" "Loop" "Case Else" "Case"
Delimiters contains <TAB> and <space>
Here's my code:
It *should* look like the above, but the unindent for ElseIf does not happen, so i get this:
I have played with this for ages, and I have no clues why it fails.
The other problem is that Else and ElseIf should unindent their own line and then indent the next one - this doesn't work either.
I realized that else and elseif are in both indent and unindent, but the problem still remains if I take them out of unindent.
Any suggestions? Thanks in advance.
/L15"VBScript" Line Comment = ' File Extensions = VBS WSF
/Function String = "^{Sub^}^{Function^} [a-z,A-Z,0-9,_, ,(,)]+$"
/Delimiters = .(),-+=|\/{}[]:;"'< >
/Indent Strings = "Then" "Do" "For Each" "For" "Else" "ElseIf"
/Indent Strings SOL = "For" "Do" "Select Case" "Case"
/Unindent Strings = "End" "Next" "Else" "ElseIf" "End If" "End Select" "End Sub" "Wend" "Loop" "Case Else" "Case"
Delimiters contains <TAB> and <space>
Here's my code:
Code: Select all
If blnFoundFile=0 Then
strRes=200
ElseIf blnFoundSect=0 Then
strRes=201
ElseIf strValue="*" Then
strRes=split(strList,"|")
ElseIf blnNextSect=1 Then
strRes=202
Else
strRes=Right(strData,Len(strData)-InStr(strData,"="))
End If
'Wscript.echo strRes,strSection,strValue,strIniFIle
ReadIniFile=strRes
On Error Resume Next
objIniFile.Close
On Error GoTo 0
End Function
Code: Select all
If blnFoundFile=0 Then
strRes=200
ElseIf blnFoundSect=0 Then
strRes=201
ElseIf strValue="*" Then
strRes=split(strList,"|")
ElseIf blnNextSect=1 Then
strRes=202
Else
strRes=Right(strData,Len(strData)-InStr(strData,"="))
End If
'Wscript.echo strRes,strSection,strValue,strIniFIle
ReadIniFile=strRes
On Error Resume Next
objIniFile.Close
On Error GoTo 0
End Function
The other problem is that Else and ElseIf should unindent their own line and then indent the next one - this doesn't work either.
I realized that else and elseif are in both indent and unindent, but the problem still remains if I take them out of unindent.
Any suggestions? Thanks in advance.