Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Cannot use parentheses when calling a Sub
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Cannot use parentheses when calling a Sub

 Post Reply Post Reply
Author
FLATLINE View Drop Down
Groupie
Groupie
Avatar

Joined: 08 July 2002
Location: Israel
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote FLATLINE Quote  Post ReplyReply Direct Link To This Post Topic: Cannot use parentheses when calling a Sub
    Posted: 23 September 2003 at 12:47pm

HTTP 500.100 - Internal Server Error - ASP error

Error Type:
Microsoft VBScript compilation (0x800A0414)
Cannot use parentheses when calling a Sub
/*********.asp, line ***, column 37
addsubcat(rsCat("cat_id"), strSpaces)
------------------------------------^

That is the error message that I get when I try to execute this function:

<%
Function addsubcat(parentID, strSpaces)

sql = "SELECT * FROM categories WHERE cat_parent = " & parentID & ";"
Set rsCat = Server.Createobject("ADODB.Recodset")
rsCat.open sql, ado

WHILE NOT rsCat.EOF

strNewSpaces = strSpaces & "&nbsp;"

Response.Write("<option value=" & rsCat("cat_id") & ">" & strNewSpaces & rsCat("cat_name") & "</option>")

addsubcat(rsCat("cat_id"), strNewSpaces)
rsCat.MoveNext

WEND
rsCat.close
Set rsCat = Nothing

End Function

%>

The error occurs every time I try to execute that function with more than one parameter. If I delete one of the paremeters from the function header and don't send it when calling it, the error doesn't appear. But I really need the second parameter.

I'm writing this new topic because I started this one but it's too confusing for a rather simpler problem.

Thanks in advance for any help!

Visit my site: DarkGreen HQ
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 23 September 2003 at 1:50pm

so what part is confusing?  the DLL is saying "don't use parathensis"

which means instead of:
addsubcat(rsCat("cat_id"), strNewSpaces)

do:
addsubcat rsCat("cat_id"), strNewSpaces

you can alternatively do:
Call addsubcat(rsCat("cat_id"), strNewSpaces)

Contribute to the working anarchy we fondly call the Internet
Back to Top
FLATLINE View Drop Down
Groupie
Groupie
Avatar

Joined: 08 July 2002
Location: Israel
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote FLATLINE Quote  Post ReplyReply Direct Link To This Post Posted: 23 September 2003 at 2:24pm

Thank you so much MorningZ!! It worked!!

I guess I need to learn a bit more about calling functions in ASP lol

Visit my site: DarkGreen HQ
Back to Top
HackerNeo View Drop Down
Newbie
Newbie
Avatar

Joined: 06 October 2003
Location: United Kingdom
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote HackerNeo Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2003 at 2:29am

Can Someonw help I'm trying to make an asp page create a file or folder using radio boxes to make my function, create the file on my web server, under the primary dir, using Scripting.FileSystemObject

For more information please contact me

Thanks

Neo

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2003 at 2:47am

Should've started a new topic for this....

This is to create a folder called "MyFolder" on the dir where the script is:

Dim objFSO
Dim objMkFolder
Dim strFolderName

strFolderName = Server.MapPath("MyFolder")

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objMkFolder = objFSO.CreateFolder(strFolderName)
Set objMkFolder = Nothing
Set objFSO = Nothing

More info: http://www.w3schools.com/asp/asp_ref_filesystem.asp



Edited by fernan82
FeRnAN
Back to Top
HackerNeo View Drop Down
Newbie
Newbie
Avatar

Joined: 06 October 2003
Location: United Kingdom
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote HackerNeo Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2003 at 2:52am

Thanks FeRnAN  I will try this now!

Neo

Back to Top
HackerNeo View Drop Down
Newbie
Newbie
Avatar

Joined: 06 October 2003
Location: United Kingdom
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote HackerNeo Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2003 at 2:53am

 FeRnAN  I would have started a new topic but I get the same error as this topic

 

I will get back to you later

Neo

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.