Windows Vista Forums

Function error
  1. #1


    Pépê Guest

    Function error

    Hello...a colleague of mine done a function in VBScript but the
    function gives an error:

    <%

    function test_String(st)
    l1 = len(st)
    teste = true

    if l1 >20 then
    teste = false
    end if

    if InStr(st, "script", 1)>0 then
    teste = false
    end if

    test_String = teste

    end function

    %>


    Microsoft VBScript compilation error '800a03ea'

    Syntax error

    /menu_lateral2.asp, line 3

    function test_String(st)
    ^


    Can anyone help me? i dont understand about VBScript and the website
    is done because of this...



      My System SpecsSystem Spec

  2. #2


    McKirahan Guest

    Re: Function error

    "Pépê" <josemariabarros@xxxxxx> wrote in message
    news:01f62f72-1450-433b-a335-afa00d63dff5@xxxxxx

    > Hello...a colleague of mine done a function in VBScript but the
    > function gives an error:
    >
    > <%
    >
    > function test_String(st)
    > l1 = len(st)
    > teste = true
    >
    > if l1 >20 then
    > teste = false
    > end if
    >
    > if InStr(st, "script", 1)>0 then
    > teste = false
    > end if
    >
    > test_String = teste
    >
    > end function
    >
    > %>
    >
    >
    > Microsoft VBScript compilation error '800a03ea'
    >
    > Syntax error
    >
    > /menu_lateral2.asp, line 3
    >
    > function test_String(st)
    > ^
    >
    >
    > Can anyone help me? i dont understand about VBScript and the website
    > is done because of this...
    To quickly test it I converted it to a VBS file:

    WScript.Echo test_String("st")
    '<%
    function test_String(st)
    l1 = len(st)
    teste = true
    if l1 >20 then
    teste = false
    end if
    if InStr(st, "script", 1)>0 then
    teste = false
    end if
    test_String = teste
    end function
    '%>

    A "Type mismatch" error was displayed.

    The cause was you use of InStr():

    The InStr function syntax has these arguments:
    start (Optional), string1, string2, compare (Optional)

    start -- The start argument is equired if compare is specified.
    compare -- If omitted, a binary comparison is performed.

    Change
    if InStr(st, "script", 1)>0 then
    to
    if InStr(1, st, "script", 1)>0 then



      My System SpecsSystem Spec

Function error problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Odd VBSCRIPT error with function call Josh VB Script 3 11 Dec 2009
pure virtual function call runtime error Robert Theys General Discussion 2 25 Jul 2009
calling imapi2 function put_MultisessionInterfaces return error caijx Vista General 0 24 Apr 2007
CompletePC Error: Incorrect Function 0x80070001 nrms Vista performance & maintenance 2 05 Apr 2007
BUG: Redirecting function contents to a file truncates function lines at the width of the console Adam Milazzo PowerShell 2 11 Aug 2006