Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2007
    Posts
    21

    Unanswered: mismatch: 'return' in function

    function langstring(fieldname)

    Set LanguageStrings = Server.CreateObject("ADODB.Recordset")
    LanguageStrings.ActiveConnection = MM_KerenDB_STRING
    LanguageStrings.Source = "SELECT * FROM langstrings WHERE Fieldname='" & fieldname & "'"
    LanguageStrings.CursorType = 0
    LanguageStrings.CursorLocation = 2
    LanguageStrings.LockType = 1
    LanguageStrings.Open()

    return LanguageStrings.fields.item(current_Language).valu e

    end function
    %>

    what am i doing wrong? thanks in advance!

    current_Language is a variable from outside of the function... do i need to give it to the function too?
    Last edited by noamsmadja; 10-29-08 at 03:42.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    You don't use returns in ASP.
    Here's what you need to do
    Code:
    <%
    Function langstring(fieldname) As String
    
      <do stuff>
    
      langstring = "return value!"
    
    End Function
    %>
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •