Forum Moderators: open

Message Too Old, No Replies

I can't see the silly syntax error.

Can you?

         

Purple Martin

4:25 am on Nov 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The following vbscript is giving an Expected Identifier error at the Sub ShowDetails... line as the page gets loaded. This means there is a silly syntax error, but for the life of me I can't see it. Are your eyes working better than mine?

<script type="text/vbscript">
Sub ShowDetails(type, subject, location, start, end, body)
Dim str
str = "Subject:\t" & subject
str = str & "\nTime:\t\t" & start & " - " & end
str = str & "\nLocation:\t" & location
If body!= "" Then
str = str & "\n\n" & body
End If
If type = "" Then
type = DHA_Portal_Title
End If
MsgBox str, 64, type
End Sub
</script>

mattglet

2:46 pm on Nov 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not seeing anything obvious, but I would look into your!= operator. In VBScript, <> is used for "not equal to". As far as I know,!= is only valid in C/Java based languages.

Purple Martin

3:12 am on Nov 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're right about the <> operator.

The thing that was causing the problem was the argument names: I'd used reserved words! Once I changed the argument names the error went away.