 |
| Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

November 17th, 2003, 04:28 PM
|
|
Registered User
|
|
Join Date: Nov 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
sub do not work with 2 variables
Hi!
Have a include file:
Function Uppdatera(s,j)
Uppdatera = s
End Function
Sub sUppdatera(s,j)
End Sub
Run it from another asp file. The funktion works but not the sub. If I change the sub to take only 1 variable it works:
Sub sUppdatera(s)
End Sub
Have first tried with things happening in the sub but have taken away more anf more. Whatever I do, when I take 2 or more variables in my sud I get server error :-( I have seen examples with 2 variables.
|
|

November 17th, 2003, 04:42 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
What's the error you get?
You should not have a problem creating a sub with more than 1 argument. How many times are you defining this sub.. I see the sub and function are different by one char so they won't interfere.
Peter
------------------------------------------------------
Work smarter, not harder.
|
|

November 17th, 2003, 04:55 PM
|
|
Registered User
|
|
Join Date: Nov 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
File sida1.asp:
<%
dim test
test = Uppdatera("w", "d")
sUppdatera(1)
%>
File adodb_databaskoppling.inc:
<%
Function Uppdatera(s,j)
Uppdatera = s
End Function
Sub sUppdatera(s)
End Sub
%>
Works fine! Then I change to:
File sida1.asp:
<%
dim test
test = Uppdatera("w", "d")
sUppdatera(1, 5)
%>
File adodb_databaskoppling.inc:
<%
Function Uppdatera(s,j)
Uppdatera = s
End Function
Sub sUppdatera(p,k)
End Sub
%>
I get "HTTP 500 Internal server error - Microsoft Internet Explorer" in the title bar. And on the page it says "The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed. " and so on.
|
|

November 17th, 2003, 05:00 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
you shouldn't use parenthesis when calling a sub - try:
Code:
<%
dim test
test = Uppdatera("w", "d")
sUppdatera 1, 5
%>
Håber det hjælper...
|
|

November 17th, 2003, 05:08 PM
|
|
Registered User
|
|
Join Date: Nov 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I LOVE YOU!!! :-)
It works now!!!!!
|
|

November 17th, 2003, 05:25 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
|

November 17th, 2003, 05:41 PM
|
|
Registered User
|
|
Join Date: Nov 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks again, you are really nice to a beginner!... And I really need help ;) It's adodb_databaskoppling.asp from now on...
|
|

November 17th, 2003, 06:00 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Glad to help :)
|
|

November 17th, 2003, 06:10 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Btw: Your initial problem with the sub would have been easily solved if you had gotten a proper error message...
Go to 'Internet Options'
Go to the advanced tab
Scroll down to 'Show friendly error messages' or something like that
(In danish it's called 'Vis meddelelser om uskadelige HTTP-fejl')
Uncheck it
This should give you more verbose error messages...
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| variables |
daniel.mihalcea |
Javascript |
1 |
September 9th, 2008 07:06 PM |
| Chapter 1 Ctrl+F5 don't work, F5 does work? |
jimboak |
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 |
7 |
June 29th, 2008 03:46 AM |
| using variables |
webgrphx |
Classic ASP Basics |
3 |
April 11th, 2007 06:46 PM |
| should this work? |
crmpicco |
Javascript How-To |
1 |
January 18th, 2005 10:56 AM |
|
 |