Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Old 01-13-2006, 09:07 PM   PM User | #1
angst
Senior Coder

 
angst's Avatar
 
Join Date: Apr 2004
Location: Toronto
Posts: 1,654
Thanks: 9
Thanked 72 Times in 72 Posts
angst is on a distinguished road
parentheses when calling a Sub

Hello,
having a problem with calling a function.

I'm getting this error:

Cannot use parentheses when calling a Sub
functions.asp, line 786
GetClientList(value,1)
----------------------^

so I change it to:
GetClientList(value)(1)

then I get this error:
Wrong number of arguments or invalid property assignment: 'GetClientList'
functions.asp, line 786

so what should I do to fix this? never had this problem before. seems kind of strange.

thanks in advance for your time!
-SiX
angst is offline   Reply With Quote
Old 01-13-2006, 09:46 PM   PM User | #2
MetalStorm
New Coder

 
Join Date: Jul 2002
Location: UK
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
MetalStorm is an unknown quantity at this point
Remove the parentheses altogether.

i.e.
Code:
GetClientList value, 1
stu.
MetalStorm is offline   Reply With Quote
Old 01-13-2006, 09:51 PM   PM User | #3
angst
Senior Coder

 
angst's Avatar
 
Join Date: Apr 2004
Location: Toronto
Posts: 1,654
Thanks: 9
Thanked 72 Times in 72 Posts
angst is on a distinguished road
ah, ok.
that seems strange, but I'll give it a try.

-SiX
angst is offline   Reply With Quote
Old 01-13-2006, 09:52 PM   PM User | #4
angst
Senior Coder

 
angst's Avatar
 
Join Date: Apr 2004
Location: Toronto
Posts: 1,654
Thanks: 9
Thanked 72 Times in 72 Posts
angst is on a distinguished road
kool,
that worked, I've never seen a sub or function called like that before,

thanks,
-Ken
angst is offline   Reply With Quote
Old 01-13-2006, 09:53 PM   PM User | #5
Grant Palin
Regular Coder

 
Join Date: Jun 2002
Location: Victoria, BC, Canada
Posts: 962
Thanks: 0
Thanked 1 Time in 1 Post
Grant Palin is an unknown quantity at this point
VBScript in Classic ASP is a little weird in that you only use parentheses when calling functions (that return a result), not when calling subs (that just do something, without returning a result).

VB.NET in ASP.NET allows usage of parentheses when calling subs. Strange...
Grant Palin is offline   Reply With Quote
Old 01-13-2006, 09:58 PM   PM User | #6
MetalStorm
New Coder

 
Join Date: Jul 2002
Location: UK
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
MetalStorm is an unknown quantity at this point
Yeah VBScript is just odd
MetalStorm is offline   Reply With Quote
Old 01-13-2006, 10:02 PM   PM User | #7
angst
Senior Coder

 
angst's Avatar
 
Join Date: Apr 2004
Location: Toronto
Posts: 1,654
Thanks: 9
Thanked 72 Times in 72 Posts
angst is on a distinguished road
ah,
ok, i see what your saying now.
I've reading about it, didn't really understand what the article was saying,

on the MS site, they were saying something about only using parentheses depending on if the value being stend to the function is ByVar, or by ByVal.

but that didn't make any sence to me..lol.

thanks again.
-SiX
angst is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 03:02 PM.

Home - Contact Us - Archives - Link to CF - Resources - Top 

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.