Asp Syntax Error Function
Contents |
+ Ask a Question Need help? Post your question and get tips & solutions from a community of 418,430 IT Pros & Developers. It's quick & easy. Weird VBScript Syntax error in an ASP declaration syntax error in function page -> '800a03ea' P: n/a NanQuan I'm hoping someone can help me solve this error syntax error outside function since I am at a total loss here. Usually I don't bother posting on any forums or groups on the internet and prefer vbscript error 800a03ea to solve stuff myself but this is a total mistery. I have a function inside an ASP page as a result of which I get the following error message: Microsoft VBScript compilation error '800a03ea' Syntax error /admin/dev/Order/process.asp, line microsoft vbscript compilation error '800a03ee' expected ')' 160 Function heenEncode(string) ^ I developed this function in a seperate ASP page and it worked with no problems what so ever. However when I finished developing it and proceeded to implement it in my another ASP page I suddenly got this weird error suggesting that there's something wrong with my syntax. Here is the function: <% Function heenEncode(string) x = Len(string) y = Len(string) a = 1 Set d = Server.CreateObject("Scripting.Dictionary") Do While x>0
800a03ea Jscript Compilation Error
T = heen(Mid(string,a,1)) d.Add x, T a = a + 1 x = x - 1 Loop Do While y>0 TT = TT + d.Item(y) y = y - 1 Loop Set d = Nothing heenEncode = TT End Function Function heen(letter) dim ArHeb,ArEng ArHeb =Array("à","á","â","ã","ä","å","æ","ç","è","é","ë" ,"ì","î","ð","ñ","ò","ô","ö","÷","ø","ù","ú","õ"," ê","ó","ï","í") ArEng =Array("a","b","c","d","e","f","g","h","i","j","k" ,"l","m","n","o","p","q","r","s","t","u","v","w"," x","y","z","@") x = 26 Do While (x > -1) If letter = ArHeb(x) Then letterT = ArEng(x) End If x = x - 1 Loop If letterT = "" Then heen = letter Else heen = letterT End If End Function %> The 2nd function is a part of the first function, but it's not defined within the first function so please don't start suggesting that as a possible cause for the problem, plus it worked fine on a seperate ASP page just as it is. Any help would be greatly appreciated, since I read through some of the posts here regarding this error, but I couldn't find any solution that will work for my specific situation. Thanks!! Jul 19 '05 #1 Post Reply Share this Question 5 Replies P: n/a Chris Barber I put it into VB 6.0 and it complained about the use of 'string' as a variable name - it's a reserved word of course as the definition of a datatype. Change it. Chris. "NanQuan"
here for a quick overview of the site Help Center Detailed answers to any questions
Microsoft Vbscript Compilation Error '800a03ea' Sub
you might have Meta Discuss the workings and policies of this vb script site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a https://bytes.com/topic/asp-classic/answers/59609-weird-vbscript-syntax-error-asp-page-800a03ea community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ASP vb compilation error 800A03EA up vote 0 down vote favorite i'm not an ASP guy but i've inherited an asp project recently. my task is pretty much to skin it up and http://stackoverflow.com/questions/13124389/asp-vb-compilation-error-800a03ea make all the functionality built over the last 10 years simply work better visually and experientially for the user. so far so good until today. i'm getting the following error message: Microsoft VBScript compilation error '800a03ea' Syntax error /test/calsearchmember.asp, line 3 if ((Request.Form("dateToToggle").Item >=0) && (Request.Form("dateToToggle").Item<=31)) ---------------------------------------------^ i have copied the site into a test directory and have been making changes there. this calendar search function works fine on the main site, but not here in the subdirectory and i hadn't changed anything to the file producing the error. any ideas? thanks! i wanted to share some more of the code itself to help paint a better picture of the problem. here's how the file is called: and here is the first bit of code (in which the error is being flagged): <% if ((Request.Form("dateToToggle").Item >=0) && (Request.Form("dateToToggle").Item<=31)) { var sql; var date = Request.Form("calsearchmonth") + "/" + Request.Form("dateToToggle") + "/" + Requ
Tutorials MSDN Communities Hub Official Docs Security Stump the SQL Guru! XML Info Information: Feedback Author an Article Functions in ASP You can write functions in ASP similar to the way you write them in VisualBASIC. http://www.4guysfromrolla.com/webtech/faq/Beginner/faq5.shtml It is good programming practice to use functions to modularize your code and to better provide reuse. To declare a subroutine (a function that returns no value), you simply type: <%@ LANGUAGE="VBSCRIPT" %>
<%
sub SubroutineName( Parameters to Pass In )
'Code for Sub...
end sub
%> A function differs from a subroutine in the fact that it returns data. To declare a function, the syntax error syntax is similar: <%@ LANGUAGE="VBSCRIPT" %>
<%
function FunctionName( Parameters to Pass In )
'Code for Function...
end function
%> Let's look at the code for a function that takes an integer value and returns the square of that value. Also included is code to call the function. <%@ LANGUAGE="VBSCRIPT" %>
<%
function Square(num)
Square = num * num end function
microsoft vbscript compilation
'Returns 25
Response.Write(Square(5))
'Should print "40 is less than 8^2"
if 40 < Square(8) then
Response.Write("40 is less than 8^2")
else
Response.Write("8^2 is less than 40")
end if
%> If you do not understand an if statement, this tutorial should help! To return a value from a function, you need to say the function's name = some value. That value is what is returned. In this case, we are returning num (the number passed in) times itself, or essentially num^2. Important! Whenever you call a function and expect it to return a value, you must use parenthesis to pass in the parameter(s). For example, we used Square(8). If you are calling a subroutine, you cannot use parenthesis. If we want to pass in value(s), we need to put a space after the sub name and then each parameter separated by a comma. Observe the example below: <%@ LANGUAGE="VBSCRIPT" %>
<%
sub PrintProfit(Revenue, Overhead, COGS, Admin)
'Create a variable to store our profit
Dim Profit
Profit = CDbl(Revenue - (Overhead + COGS + Admin))
Response.Write("$" & Profit)
end sub
'Call the sub with v