Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Variables to Subroutine. 1

Status
Not open for further replies.

JonathanG6SWJ

Programmer
Joined
Jan 18, 2005
Messages
39
Location
GB
I can successfully pass one variable to a subroutine but if I try 2 or more I get error message "Invalid procedure call or argument"

My Subroutine Code

<%Sub DisplayQuestionNumber(LineColour,QN)
Response.Write ("<tr>")
Response.Write ("<td width=29 align=center valign=middle style='background-color=" & LineColour &"' height=1><font face=Gill Sans>" & QN &" </font></td>")
End Sub

I call the subroutine
<%
LineColour="#AABDFF"
DisplayQuestionNumber(LineColour,22)
%>

Why can't I pass multiple values to subroutine?
Many thanks in advance.
Jonathan
 
it's because you have the parameters in parenthesis
parathesis are only allowed when used with a function to set a value
eg temp = DisplayQuestionNumber(LineColour,22)

use
Code:
DisplayQuestionNumber LineColour,22


Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top