calling functions

Discussion in 'ASP General' started by niv, Jun 30, 2003.

  1. niv

    niv Guest

    how do i call a vbscript function (which is between <%%>)
    from a vbscript script function (which is between script
    tags-<script language="vbscript"></script>, and how do the
    argument are reffered/transfered?
    the code goes like this:
    <%function LegalCatNum(num)
    if....then
    LegalCatNum=true
    else
    LegalCatNum=false
    end if
    end function %>
    <script language="vbscript">
    function XY
    if LeaglCatNum(arg) then <--this line is the problem
    else ....
    end if
    end function
    </script>

    thanks a lot in advance
    niv
     
    niv, Jun 30, 2003
    #1
    1. Advertisements

  2. niv

    Ken Schaefer Guest

    You can't do that per se.

    <% ' This code is run on the server %>

    <script language="vbscript">
    ' This code is run on the client
    </script>

    You can't call server-side code from a client-side function, because by the
    time the page has been delivered to the client, the server has forgotten all
    about the page.

    Cheers
    Ken


    : how do i call a vbscript function (which is between <%%>)
    : from a vbscript script function (which is between script
    : tags-<script language="vbscript"></script>, and how do the
    : argument are reffered/transfered?
    : the code goes like this:
    : <%function LegalCatNum(num)
    : if....then
    : LegalCatNum=true
    : else
    : LegalCatNum=false
    : end if
    : end function %>
    : <script language="vbscript">
    : function XY
    : if LeaglCatNum(arg) then <--this line is the problem
    : else ....
    : end if
    : end function
    : </script>
    :
    : thanks a lot in advance
    : niv
     
    Ken Schaefer, Jun 30, 2003
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.