Public Function BinarySearch(userNameString, switchPosition) As Boolean
If Right(LCase(userNameString), 8) = "lastname" Then
If Left(LCase(userNameString), 5) = "admin" Or Left(LCase(userNameString, 7) = "firstname" Then
If StrComp(switchIsOn(switchPosition), "1", vbTextCompare) = 0 Then
' Verify the user is admin lastname or firstname lastname and switch is on
Return True
Else
' Verify the user is admin lastname or firstname lastname and switch is off
Return False
End If
Else
' Users last name is lastname
Return False
End If
Else
' Not lastname
Return False
End If
End Function
When I run it, I get an error on the first line Public Function…
What I get is
“Microsoft VBScript compilation error: Expected statement”
You cannot type in VBScript so:
Public Function BinarySearch(userNameString, switchPosition)
As Boolean