If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > mismatch: 'return' in function

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-29-08, 02:37
noamsmadja noamsmadja is offline
Registered User
 
Join Date: Dec 2007
Posts: 21
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 02:42.
Reply With Quote
  #2 (permalink)  
Old 10-29-08, 04:34
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
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
Twitter | Blog
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On